3 <title
>String Functions
</title
>
8 $firstString = "The quick brown fox";
9 $secondString = " jumped over the lazy dog.";
12 $thirdString = $firstString;
13 $thirdString .= $secondString;
17 Lowercase
: <?php
echo strtolower($thirdString); ?
><br
/>
18 Uppercase
: <?php
echo strtoupper($thirdString); ?
><br
/>
19 Uppercase first
-letter
: <?php
echo ucfirst($thirdString); ?
><br
/>
20 Uppercase words
: <?php
echo ucwords($thirdString); ?
><br
/>
22 Length
: <?php
echo strlen($thirdString); ?
><br
/>
23 Trim
: <?php
echo $fourthString = $firstString . trim($secondString) ?
><br
/>
24 Find
: <?php
echo strstr($thirdString, "brown"); ?
><br
/>
25 Replace by
string: <?php
echo str_replace("quick", "super-fast", $thirdString); ?
><br
/>
27 Repeat
: <?php
echo str_repeat($thirdString, 2); ?
><br
/>
28 Make substring
: <?php
echo substr($thirdString, 5, 10); ?
><br
/>
29 Find position
: <?php
echo strpos($thirdString, "brown"); ?
><br
/>
30 Find character
: <?php
echo strchr($thirdString, "z"); ?
><br
/>