Creating an array from a pipe-delimited string Perl-compatible Regular Expression functions
$query_string = “ 123 | 456 | 789 “;
$pipe_list = preg_split("/\|/",$query_string); // Create an array of strings
while ( list($key,$value) = each($pipe_list)) { // for each element in the array...
Create an array from pipe demimited string
- Split string by a regular expression.
- Returns an array containing substrings.
- The syntax closely resembles Perl.