want to convert a string into array [duplicate]

try this;

$answer = "8|$0-$100,000<>9|$3-$100,000<>10|$2-$100,000";

$answer = preg_replace("^[0-9]*\|^", "", $answer); // remove the number and |
$answer = str_replace("$", "", $answer); // remove $ sign 
$answer = explode("<>", $answer);

Browse More Popular Posts

Leave a Comment