regex - Simple question, comma delimited id's to array in php 5.2 -
I have a comma delimited string id which is coming in and I want some quick way to divide them into the array. I know I can decode it hard, but it is only gross and in vain.
I do not know anything that I have to learn again and I can not find a simple example anywhere on the internet, how to master in regular expressions in 2 hours or something.
fgetcsv is only applicable for one file and str_getcsv is only available in PHP 5.3 and above.
So, am I going to write it by hand or is there something that will make it for me? I like a simple regex solution with a little clarification, as it does, why this happens.
$ string = "1,3,5,9,11"; $ Array = explosion (',', $ string);
View
Returns an array of strings, each of which is a string of strings that is divided on the boundaries formed by string delimiter.
Comments
Post a Comment