RonnyNishimoto
08-15-2012, 06:36 PM
How would I use preg_match_all in order to have this pattern:
<?php
$file1 = file_get_contents("basketball.txt"); // $file1 = kobe&bryant?dwayne&wade
preg_match_all("&?", $file1, $matches);
$select = array_combine($matches[0], $matches[1]);
?>
In order to output:
$select[0] = "kobe"
$select[1] = "bryant"
$select[2] = "dwayne"
$select[3] = "wade"
Thank you!
<?php
$file1 = file_get_contents("basketball.txt"); // $file1 = kobe&bryant?dwayne&wade
preg_match_all("&?", $file1, $matches);
$select = array_combine($matches[0], $matches[1]);
?>
In order to output:
$select[0] = "kobe"
$select[1] = "bryant"
$select[2] = "dwayne"
$select[3] = "wade"
Thank you!