Created
April 27, 2018 10:12
-
-
Save JamesHusband/03ab5ad64209efbe34135efc65e21b6a to your computer and use it in GitHub Desktop.
This file contains 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
function testme() { | |
$classes = array( | |
'test', | |
'test2', | |
); | |
$class_array = ''; | |
foreach ( $classes as $class ) { | |
$class_array .= $class . ' '; | |
} | |
$output = 'class="' . $class_array . '"'; | |
echo $output; | |
// Echo = class="test test2 " | |
} | |
// Best way of removing trailing white space? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment