Created
July 27, 2013 11:58
-
-
Save wpscholar/6094670 to your computer and use it in GitHub Desktop.
Convert an associative array of attributes to a string suitable for use in HTML.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_attribute_string(array $atts ) { | |
foreach( $atts as $key => &$value ) { | |
$value = "{$key}=\"{$value}\""; | |
} | |
return join( ' ' , $atts ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment