meta([$name = ''[, $content = ''[, $type = 'name'[, $newline = "n"]]]])
Parameters: |
|
---|---|
Returns: |
HTML meta tag |
Return type: |
string |
Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones.
Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | echo meta( 'description' , 'My Great site' ); // Generates: <meta name="description" content="My Great Site" /> echo meta( 'Content-type' , 'text/html; charset=utf-8' , 'equiv' ); // Note the third parameter. Can be "equiv" or "name" // Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> echo meta( array ( 'name' => 'robots' , 'content' => 'no-cache' )); // Generates: <meta name="robots" content="no-cache" /> $meta = array ( array ( 'name' => 'robots' , 'content' => 'no-cache' ), array ( 'name' => 'description' , 'content' => 'My Great Site' ), array ( 'name' => 'keywords' , 'content' => 'love, passion, intrigue, deception' ), array ( 'name' => 'robots' , 'content' => 'no-cache' ), array ( 'name' => 'Content-type' , 'content' => 'text/html; charset=utf-8' , 'type' => 'equiv' ) ); echo meta( $meta ); // Generates: // <meta name="robots" content="no-cache" /> // <meta name="description" content="My Great Site" /> // <meta name="keywords" content="love, passion, intrigue, deception" /> // <meta name="robots" content="no-cache" /> // <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
Please login to continue.