<?php
$text = " Hello PHP! ";
echo strlen($text); // 11
echo strtolower($text); // hello php!
echo strtoupper($text); // HELLO PHP!
echo trim($text); // removes extra spaces
echo str_replace("PHP", "World", $text); // Hello World!
?>
Explanation:
PHP has many string functions for modifying and formatting text.
Leave a Reply