PHP add character to the end of every new word -


i have string of words separated spaces (except last word) , know if there way add character end of each new word. example:

$string = "this short string of words" 

would become

$string = "this; is; a; short; string; of; words;" 

thanks

$str = 'lorem ipsum';   $str_modified = str_replace(' ','; ',trim($str)).';'; 

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 -