Welcome Guest, Not a member yet? Register   Sign In
keywords separated by comma
#1

[eluser]ravi kiran[/eluser]
I have a string and each keyword is separated by comma..do we have any codeigniter function to extract each keyword from the string.

Thanks
ravi Kiran
#2

[eluser]Unknown[/eluser]
I believe you are just looking for the PHP function explode().

$arrayofvalues = explode(",", $originalstring);

The first option of the function is the character (or characters) that you want to split the string apart with. In your case it's a comma.
#3

[eluser]Dam1an[/eluser]
To add to what trafficlight said, you may then want to trim each item in the array, as you may have additional whitespace
#4

[eluser]rameners[/eluser]
php supports tokenizer, or put your data on an xml format




Theme © iAndrew 2016 - Forum software by © MyBB