How to Compare String length in PHP?

General discussion on PHP

How to Compare String length in PHP?

Postby ashi4275 on Fri Nov 18, 2016 10:44 am

Hi, I am a developer. I have been searching for best suited developer forum which provide helpful information on php development, so that I can get help from its active members to get good learning on how to compare string length in php programming. I have searched alot of forums but didn't get the fruitful answer. I am hoping to get my query resolved and also looking to get informative links of such more forums.
ashi4275
 
Posts: 15
Joined: Fri Jul 15, 2016 10:02 am

Re: How to Compare String length in PHP?

Postby zvika on Tue Nov 22, 2016 8:21 am

Have you tried a Google search for "How to Compare String length in PHP?"
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 986
Joined: Sun Dec 14, 2008 9:48 am

Re: How to Compare String length in PHP?

Postby eva3688 on Wed Dec 07, 2016 9:12 am

How to tally the length of a PHP string? This capacity is required to check some shape approval likewise where any info field is entered clear. PHP work strlen does this work for us and returns number of characters inside the string including clear space. On the off chance that you need clear space to be evacuated then you can apply string supplant work str_replace to the string before applying strlen.
eva3688
 
Posts: 1
Joined: Wed Dec 07, 2016 9:02 am

Re: How to Compare String length in PHP?

Postby judy6640 on Sat Jun 17, 2017 10:24 am

ashi4275 wrote:Hi, I am a developer. I have been searching for best suited developer forum which provide helpful information on php development, so that I can get help from its active members to get good learning on how to compare string length in php programming. I have searched alot of forums but didn't get the fruitful answer. I am hoping to get my query resolved and also looking to get informative links of such more forums.

Int strcmp (string str1, string str2)
This function compares the two strings character-by-character (more precisely) and returns:

0 - if the lines completely match;

-1 - if string str1 is lexicographically smaller than str2;

1 - if, conversely, str1 "is greater than" str2.
judy6640
 
Posts: 9
Joined: Sat Jun 17, 2017 10:07 am


Return to PHP

Who is online

Users browsing this forum: No registered users and 3 guests

cron