1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

Your code echoing : 34 with 'htpp://' but 2nd not echoing cause dont'have symbol ',' in the end.. How fix?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.