3. The addcslashes() function returns a string with backslashes
in front of the specified characters.
$str = "Welcome to my humble Homepage!";
echo addcslashes($str,'m')."<br>";
echo addcslashes($str,a..z')."<br>";
Output
Welcome to my humble Homepage!
Welcome to my humble Homepage!
4. Returns a string with backslashes in front of predefined
characters
$str = "Is your name O'Reilly?";
echo addslashes($str);
Outputs:
Is your name O'Reilly?
5. Breaks a string into an array
$myStr = "We are lerning PHP"; delimiter
print_r (explode(" " ,$myStr)); source string
output
Array (
[0] => We
[1] => are
[2] => lerning
[3] => PHP
)
7. Returns a string from the elements of an array
$arr = array('Hello','World!','Beautiful','Day!');
echo implode(',', $arr);
Output:
Hello,World!,Beautiful,Day!
13. Converts the first character of a string to uppercase
<?php
echo ucfirst("hello world!");
?>
Output:
Hello world!
14. Converts the first character of each word in a string to
uppercase
<?php
echo ucwords("hello world hello world hello world");
?>
Output:
Hello World Hello World Hello World
15. <?php
$x = '<h1><span>Bangladesh is a country of natural
beauty</span></h1>
<p>I love codeing</p> <h3> Alomgir </h3>‘ ;
echo strip_tags($x,'<h1><p><h3>');
?>
output:
Bangladesh is a country of natural beauty
I love codeing
Alomgir