Quote:
Originally Posted by raj hi,
Can any one give solution for this using Regular Expression or any other php
functions?
I have the string:
$vStr = ' hi this "Raj Test" regular "expression functions" '
i want split this string using space but any string within the double quotes
you should take as single word.
i want to store an array like this:
$arrVal = ("hi", "this", "Raj Test", "regular", "expression functions") |
Hi Raj,
For Your Query, I found that answer and i hope that its a Correct one.
Here the Code for your query about Splitting a string blahhh......
PHP Code:
$vStr = ' hi this "Raj Test" regular "expression functions" ';
$arrVal = preg_split("/\s(\"[a-zA-Z]+\s[a-zA-Z]+\")*/",$vStr,-1,PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
print_r( $arrVal);
Regards, VELHARI 