Solved

find string

Posted on 2009-05-06
1
134 Views
Last Modified: 2012-05-06
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..
0
Comment
Question by:XK8ER
1 Comment
 
LVL 19

Accepted Solution

by:
Michael701 earned 500 total points
ID: 24317773
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question