This is my original string :
$license_str = "<strong>Code#1: </strong>11516331226428373002<br><strong>Code#2: </strong>11512231686337183002<br>";
First I tried to strip html tags so :
$license_str = strip_tags($license_str );
output would be :
Code#1: 11512231686337183002Code#2: 11516331686337183002
Then I ran preg_split to extract two license codes :
$license_code = preg_split("@: @",$license_str,Null,PREG_SPLIT_NO_EMPTY);
output is wrong :
array(3) {
[0]=>
string(6) "Code#1"
[1]=>
string(26) "11512231686337183002Code#2"
[2]=>
string(20) "11512231686337183002"
}
It must return two array value with two license number
Is there a better way to do this?
PS. : Code#1 and Code#2 is dynamic and we could have #3 or any other number