12-strings.php
<?php
$x = " John World ";
// echo "Hello $x";
// $x = "John";
// echo 'Hello $x';
// strtoupper
// strtolower
// str_replace
// str_rev
// trim
// array to string using explode
// string to array using implode
echo strtolower($x);
echo '</br>';
echo strtoupper($x);
echo '</br>';
echo trim($x);
echo '</br>';
$x = "Hello World!";
$y = explode(" ", $x);
//Use the print_r() function to display the result:
print_r($y);
echo '</br>';
echo substr($x, 6,5);
echo '</br>';
echo substr($x, 6);
echo '</br>';
echo substr($x, -5, 3);
echo '</br>';
$x = "We are the so-called \"Vikings\" from the north.";
$x = "We are the so-called 'Viking' from the north.";
?>
=
No comments:
Post a Comment