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..
    – Naruto
    Oct 3, 2013 at 8:36
  • 1
    Sounds like you're looking for explode() Oct 3, 2013 at 8:36
  • Yes.I have used explode('+',s) and its working fine.Thanks dieter and billy.
    – ravikanth
    Oct 3, 2013 at 8:41

1 Answer 1

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

working code :)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.