Strcmp php

코드 예제

2
0

php 에서 문자열 비교

//In php to compare two string we can use strcmp() function
Syntax
strcmp(string1,string2);

//If both string is same then it will return 0
<?php
echo strcmp("Hello world!","Hello world!");
?>
2
0

문자열에서 비교 php

//In php to compare two string we can use strcmp() function
Syntax
strcmp(string1,string2);

//If both string is same then it will return 0
<?php
echo strcmp("Hello world!","Hello world!");
?>
1
0

strcmp php

// This function is used to find whether two strings are same or not.
// Syntax
strcmp(string1,string2);
// It returns
// 0 if string1 and string2 are same
// less than zero if string1 is smaller than string2
// greater than zero if string1 is greater than string2
0
0

strcmp php

strcmp("5", 5) => 0
 
-1
0

php 의 strpos


<?php
$mystring = 'abc';
$findme   = 'a';
$pos = strpos($mystring, $findme);

// Note our use of ===.  Simply == would not work as expected
// because the position of 'a' was the 0th (first) character.
if ($pos === false) {
    echo "The string '$findme' was not found in the string '$mystring'";
} else {
    echo "The string '$findme' was found in the string '$mystring'";
    echo " and exists at position $pos";
}
?>

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................