1 Answers

3
votes

Try using:

if(preg_match_all('#\d+\|(.*?),#',$urlmap,$b))

there is a number before | we need to consider and also | is a meta char in regex, so we need to escape it. But this not give you the complete URL.

Instead you can split the input on the pattern digits| as:

$arr = preg_split('/\d+\|/',$input,-1, PREG_SPLIT_NO_EMPTY  );

EDIT:

Working example