php - Make every word in a string into classes -
i trying create cms-system can add photos website, , photo-part, want have ability enter programs had used create photo.
i should possible add more 1 program.
right saving programs in database this:
in programs-row:
photoshop illistrator indesign
then @ website, nice if icons/logos of used programs, show next photo.
so question how create new div, new class, based on words programs-row?
fx:
photoshop illustrator indesign
becomes to:
<div class="photoshop"></div> <div class="illustrator"></div> <div class="indesign"></div>
hope guys can me problem :)
thanks ;)
use explode function , foreach loop perform string manipulation.
$programs = explode(" ", $data); foreach($programs $value) { //echo out html - $value contains program name }
i leave figure out how format program name html need.
Comments
Post a Comment