PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

how to compare strings in PHP?


If you want to compare strings, then you should use the strcmp() function in PHP.

Points to note with this function are as follows:

- it is case sensitive

- it returns a number as follows:
<0 if the first string is less than the second string, it returns >0 if the opposite is true, and it returns 0 if they are equal

the two arguments to the function are simply the first string and the second string.

Comments on this Question/Answer

How do I compare email address to see if they match
By: Ike Martin, 21 Aug 2009 08:56:32



Reply to comments / post your own comment >>>

ASK A QUESTION

More strings PHP Questions

What is the usage of {} in strings?

How do I one-way encrypt a string in PHP?

How do I calculate the MD5 hash of a string?

How do I replace a word in a string in PHP?

How can I remove trailing space from a string?



Custom Search