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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -