Hi,
I had problem with using regular expression in php.
For example
$value="safdha","sfafha","safaff";
I am getting the above string from a file.I want individual values of a given string.Like safdha...
I used
preg_split("/\"(\s*)\"\,?",$value);
But I am not getting any result..
can any one help me regarding this..
Thanks in Advance..
Regarding Regular Expression in php
Moderator: General Moderators
Re: Regarding Regular Expression in php
Code: Select all
$str = '$value="a","b","c";';
preg_match_all('/\"(.*?)\"(\s)?(\,|\;)(\s)?/', $str, $matches);
print_r($matches);Re: Regarding Regular Expression in php
it is not working..............
Re: Regarding Regular Expression in php
Thank you..I am appreciating your work...
Re: Regarding Regular Expression in php
10xMcInfo wrote: PHP 5.3.0 introduces the function str_getcsv() which can be used on $value like fgetcsv() is used on the contents of a file.