Prepend character to array of items in PHP

r3delmasry

New Member
I am trying to take a string like...\[code\]php,mysql,css\[/code\]and turn it into .. \[code\]#php #mysql #css\[/code\]What I have so far... \[code\]$hashTagStr = "php,mysql,css";$hashTags = explode(",", $hashTagStr);foreach($hashTags as $k => $v){ $hashTagsStr = ''; $hashTagsStr .= '#'.$v.' ';}echo $hashTagsStr;?>\[/code\]Problem is it only prints \[code\]#css\[/code\]
 
Back
Top