How to perform a preg_match this
$needle = '"pid": "20"';
$haystack = '"pid": "1"' . '"pid": "12"' . '"pid": "20"' . '"pid": "14"';
and by the way the needle numeric value is not static
i am novice at preg_match
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is exactly what you asked for, but if you provide what your expected output is or how you receive your haystack, there may be a better suited solution than regular expressions.
$matchesOutputTo learn more about regular expressions, check out this basic syntax reference.