php - Separate the words of a text by a special character " , " -
this question has answer here:
i have question
i text input[type="text"]
this:
<input type="text" name="tags"/>
i received string value looks this:
$tags = $_post['tags']; $tags = "car,bmw,speed,fast";
i need separate words "," , add $arr
:
$tag_arr = ['car','bmw','speed','fast'];
how can !?
thanks
use "explode" function present in php. below
$tags = explode(",","car,bmw,speed,fast");
Comments
Post a Comment