It compares two strings using a “natural” algorithm.
Example
<?php
echo strnatcmp(“PHPCode”,”PHPCodez”);
?>
Output
-1
It compares two strings using a “natural” algorithm.
Example
<?php
echo strnatcmp(“PHPCode”,”PHPCodez”);
?>
Output
-1
It compares two strings using a “natural” algorithm.
Example
<?php
echo strnatcasecmp(“PHPCode”,”PHPCodez”);
?>
Output
-1
It find the string length
Example
<?php
echo strlen(‘info@phpcodez.com’);
?>
Output
17
It find the first occurrence of a string(case insensitive)
Example
<?php
echo stristr(‘info@phpcodez.com’, ‘@’, true);
?>
Output
info
It removes backslashes added by the addslashes() function.
Example
<?php
echo stripslashes(“phpcode”);
?>
Output
phpcode
It returns the position of the first occurrence of a string inside another string
Example
<?php
echo stripos(“phpcode”,”code”);
?>
Output
3
It removes backslashes added by the addcslashes() function
Example
<?php
echo stripcslashes(“phpcode”);
?>
Output
phpcode
It strips HTML and PHP tags from a string
Example
<?php
echo strip_tags(“
phpcode
“);
?>
Output
phpcode
It returns the number of characters found in a string before any part of the specified characters are found.
Example
<?php
echo strcspn(“phpcode”,”c”);
?>
Output
3
It compares two strings based on locale setting
Example
<?php
echo strcoll(“phpcode”, “PHPCode”);
?>
Output
1