find string

hello there,
how can I make something so that if strings like these

'successfully submitted'
'Thank you for submitting'
'submitted successfully'

are found in a data to echo success..
LVL 1
XK8ERAsked:
Who is Participating?
 
Michael701Connect With a Mentor Commented:
guess you could just use strpos to see if the string is in the data

there is probably a better preg_grep but I'm not an expert with them

if (strpos($data, 'successfully submitted')!==false or strpos($data, 'Thank you for submitting')!==false or strpos($data, 'submitted successfully')!==false)
{
  echo "success";
}

// !== false is a special check to make 'not found' different the 'found start of data' which returns a zero
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.