String Functions in PHP
PHP provides a wide range of built-in functions to manipulate strings. These functions can be used to perform tasks such as concatenation, trimming, searching, and replacing.
Example:
perl
$name = "John Doe";
$length = strlen($name); // string length
$upper = strtoupper($name); // convert to uppercase
$lower = strtolower($name); // convert to lowercase
$replace = str_replace("John", "Mary", $name); // replace string
No comments:
Post a Comment