It find the string length
Example
<?php
echo strlen(‘info@phpcodez.com’);
?>
Output
17
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(“<div><p>phpcode</p></div>”);
?>
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
It compares two strings
Example
<?php
if (strcmp(“phpcode”, “PHPCode”) == 0) {
echo ‘Strings are equal’;
}else{
echo ‘Strings are not equal’;
}
?>
Output
Strings are not equal
Its an alias of strstr() and find the first occurrence of a string
Example
<?php
echo strchr(‘info@phpcodez.com’, ‘@’, true);
?>
Output
info