0

I have a string "[email protected]+test+7".I want to extract [email protected], test and 7 into an array. How to achieve this is PHP? I have tried using preg_match but couldn't crack it.

3
  • If the + character always means another string, use the explode function.. Commented Oct 3, 2013 at 8:36
  • 1
    Sounds like you're looking for explode() Commented Oct 3, 2013 at 8:36
  • Yes.I have used explode('+',s) and its working fine.Thanks dieter and billy. Commented Oct 3, 2013 at 8:41

1 Answer 1

1
print_r(explode("+","[email protected]+test+7"));

working code :)

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

Comments

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.