{"id":169,"date":"2018-07-12T11:03:10","date_gmt":"2018-07-12T11:03:10","guid":{"rendered":"http:\/\/itp9.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=169"},"modified":"2018-12-07T10:57:50","modified_gmt":"2018-12-07T10:57:50","slug":"strings-with-php","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/chapter\/strings-with-php\/","title":{"rendered":"Strings with PHP"},"content":{"raw":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/WPCOPu3ge00\" target=\"_blank\" rel=\"noopener\"><img src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a>\r\n<\/span><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>Strings<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">As the HTML form submitted data received by server as string, string is an important part of PHP application. Strings can be used single quotes or double quotes. When string is created using double quotes, then PHP engine perform variable substitution. Variable substitution means variable name is replace by the variable value. When variable name is replace by variable value at that if necessary PHP converts the variable value into string. The conversion of variable value into string is known as interpolation.<\/p>\r\n&nbsp;\r\n\r\nLet us understand it by an example.\r\n\r\n$count = 3;\r\n\r\n$item = \"Ice Cream\";\r\n\r\n$msg1 = \"I have $count $item.\";\r\n\r\n$msg2 = \"I have $count $items.\";\r\n\r\n$msg3 = \"I have $count $item s.\";\r\n\r\n$msg4 = \"I have $count ${item}s.\";\r\n\r\necho \"&lt;br&gt; Message 1 : $msg1\";\r\n\r\necho \"&lt;br&gt; Message 2 : $msg2\";\r\n\r\necho \"&lt;br&gt; Message 3 : $msg3\";\r\n\r\necho \"&lt;br&gt; Message 4 : $msg4\";\r\n\r\n&nbsp;\r\n\r\nThe curly braces { } is used to separate variable name with text shown\u00a0 in $msg4.\r\n\r\n&nbsp;\r\n\r\n<strong>Escape Sequence with String<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe escape sequence behave differently for single quote and double quotes.\r\n\r\nThe \\\u00a0\u00a0\u00a0 (read as back slash) works for single quote and double quotes.\r\n\r\n&nbsp;\r\n\r\nFor example:\r\n\r\n&nbsp;\r\n\r\n$dir1 = 'H:\\wamp\\www\\PGWAD';\r\n\r\necho \"&lt;br&gt; $dir1\";\r\n\r\n$dir2 = 'H:\\\\wamp\\\\www\\\\PGWAD';\r\n\r\necho \"&lt;br&gt; $dir2\";\r\n\r\n&nbsp;\r\n\r\n$music = 'Meet \\'s Music Store';\r\n\r\necho \"&lt;br&gt; $music\";\r\n\r\n&nbsp;\r\n\r\n$newmusic = \"Meet's Music Store\";\r\n\r\necho \"&lt;br&gt; $newmusic\";\r\n\r\n&nbsp;\r\n\r\n$demo = \"He said it costs $12\";\r\n\r\necho \"&lt;br&gt; $demo\";\r\n\r\n&nbsp;\r\n\r\nThen the output for the following is:\r\n\r\n<\/div>\r\n<div>\r\n\r\n\u00a0 \u00a0 H:\\wamp\\www\\PGWAD\r\n\r\nH:\\wamp\\www\\PGWAD\r\n\r\nMeet 's Music Store\r\n\r\nMeet's Music Store\r\n\r\nHe said it costs $12\r\n\r\n&nbsp;\r\n\r\n<strong>In-Built useful String Functions<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">PHP provides many built in functions. Below is the list of various types of string functions provided by PHP.<\/p>\r\n\r\n<ul>\r\n \t<li>Function for working with string length<\/li>\r\n \t<li>Functions that search a string<\/li>\r\n \t<li>Functions that replace part of a string<\/li>\r\n \t<li>Functions that modify the strings<\/li>\r\n \t<li style=\"text-align: justify\">Functions that convert between strings and arrays<\/li>\r\n \t<li>Functions that convert between strings and ASCII integer values<\/li>\r\n \t<li>Functions for compare two strings<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<strong>Functions for working with string length and substrings<\/strong>\r\n\r\n&nbsp;\r\n<table class=\"aligncenter\" style=\"height: 52px\" border=\"1\">\r\n<tbody>\r\n<tr style=\"height: 14px\">\r\n<td style=\"width: 141.063px;height: 14px\"><strong>Function<\/strong><\/td>\r\n<td style=\"width: 430.063px;height: 14px\"><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"height: 14px\">\r\n<td style=\"width: 141.063px;height: 14px\">empty($str)<\/td>\r\n<td style=\"width: 430.063px;height: 14px\">Returns true if $str is empty(\u201c\u201d), a Null Value or \u201c0\u201d.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 14px\">\r\n<td style=\"width: 141.063px;height: 14px\">strlen($str)<\/td>\r\n<td style=\"width: 430.063px;height: 14px\">Retruns the length of the string $str.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 10px\">\r\n<td style=\"width: 141.063px;height: 10px\" rowspan=\"4\">substr($str, $i[, $len])\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;<\/td>\r\n<td style=\"width: 430.063px;height: 10px\" rowspan=\"4\">Retruns substring from the string $str. $i is used to make start\r\n\r\nposition for substring $str. $len is used to determine length. If\r\n\r\n$len is omitted, then the string starts from $i to the end of the\r\n\r\nstring $str. The first character is at 0th position.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n&lt;?php\r\n\r\n\/\/empty\r\n\r\n$phone = 9876543210;\r\n\r\nif(empty($phone))\r\n\r\n{\r\n\r\necho \"&lt;br&gt; phone is not set\";\r\n\r\n}\r\n\r\nelse\r\n\r\n{\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; phone is set: $phone\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">}<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">\/\/strlen<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$str = \"Hiren Joshi\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$len = strlen($str);<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; The length of string $str is :$len\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">\/\/substr<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$sub = substr($str,6,5);<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; The substring of $str is $sub\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">?&gt;<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>The output will be:<\/strong>\r\n\r\n&nbsp;\r\n\r\nphone is set: 9876543210\r\n\r\nThe length of string Hiren Joshi is :11\r\n\r\nThe substring of Hiren Joshi is Joshi\r\n\r\n&nbsp;\r\n\r\n<strong>Functions that search a string<\/strong>\r\n\r\n&nbsp;\r\n<table class=\"aligncenter\" border=\"1\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 198.063px\"><strong>Function<\/strong><\/td>\r\n<td style=\"width: 441.063px\"><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 198.063px\" rowspan=\"4\">Strpos($str1, $str2 [,$offset])\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;<\/td>\r\n<td style=\"width: 441.063px\" rowspan=\"4\">Search\u00a0 the first occurrence of $str2 in $str1. If found then\r\n\r\nreturns integer number of the first occurrence.\u00a0 The optional\r\n\r\n$offset helps to determine start position for occurrence of $str1\r\n\r\nin $str1.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 198.063px\">Stripos($str1, $str2 [,$offset])<\/td>\r\n<td style=\"width: 441.063px\">Case in-sensitive version of strops function.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 198.063px\" rowspan=\"2\">Strrpos($str1, $str2 [,$offset])\r\n\r\n&nbsp;<\/td>\r\n<td style=\"width: 441.063px\" rowspan=\"2\">Same as strops except it statrt searching from the end of the\r\n\r\nstring to the start of the string.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 198.063px\">Strtipos($str1, $str2 [,$offset])<\/td>\r\n<td style=\"width: 441.063px\">Case in-sensitive version of strrpos function.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&lt;?php\r\n\r\n\/\/strpos\r\n\r\n$str = \"Hiren Joshi\";\r\n\r\n$pos = strpos($str,'h');\r\n\r\necho \"&lt;br&gt; character h is found at position (strpos): $pos\"; \/\/stripos\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$ipos = stripos($str,'h');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; character h is found at position (stripos): $ipos\"; \/\/strrpos<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$rpos = strrpos($str,'h');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; character h is found at position (strrpos): $rpos\"; \/\/strripos<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$ripos = strripos($str,'h');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; character h is found at position(strripos): $ripos\"; \/\/offset<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$without = stripos($str,\"h\");<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; character h is found at position( without offset strripos): $without\"; $offset = stripos($str,\"h\",1);<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; character h is found at position( with offset strripos): $offset\"; ?&gt;<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>The output will be:<\/strong>\r\n\r\n&nbsp;\r\n\r\ncharacter h is found at position (strpos): 9\r\n\r\ncharacter h is found at position (stripos): 0\r\n\r\ncharacter h is found at position (strrpos): 9\r\n\r\ncharacter h is found at position(strripos): 9\r\n\r\ncharacter h is found at position( without offset strripos): 0\r\n\r\ncharacter h is found at position( with offset strripos): 9\r\n\r\n&nbsp;\r\n\r\n<strong>Functions that replace part of a string<\/strong>\r\n\r\n&nbsp;\r\n<table class=\"aligncenter\" border=\"1\">\r\n<tbody>\r\n<tr>\r\n<td><strong>Function<\/strong><\/td>\r\n<td><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td>str_replace($str1, $new, $str2)<\/td>\r\n<td>Return a new string which replace $str with $new in $str2.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>str_ireplace($str1, $new, $str2)<\/td>\r\n<td>Case-insensitive version of str_replace function.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&lt;?php\r\n\r\n$str = \"Hello Rohit\";\r\n\r\n$ans =str_replace(\"Hello\",\"Hi!\",$str);\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original string is $str &lt;br&gt; replaced with $ans\"; $irep = str_ireplace(\"r\",\"M\",$str);<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original string is $str &lt;br&gt; replaced with $irep\"; ?&gt;<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Program output is:<\/strong>\r\n\r\n&nbsp;\r\n\r\nOriginal string is Hello Rohit\r\n\r\nreplaced with Hi! Rohit\r\n\r\nOriginal string is Hello Rohit\r\n\r\nreplaced with Hello Mohit\r\n\r\n&nbsp;\r\n\r\n<strong>Functions that modify the strings<\/strong>\r\n\r\n&nbsp;\r\n<table class=\"aligncenter\" style=\"height: 863px\" border=\"1\" width=\"750\">\r\n<tbody>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 115.063px\"><strong>Function<\/strong><\/td>\r\n<td style=\"height: 28px;width: 98.0625px\"><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"height: 0px\">\r\n<td style=\"height: 57px;width: 115.063px\" rowspan=\"2\">ltrim($str)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 57px;width: 98.0625px\" rowspan=\"2\">Return a new string which trimmed white spaces from the left\r\n\r\nside of the $str.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 112.063px\" rowspan=\"2\">rtrim($str)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 28px;width: 142.063px\" rowspan=\"2\">Return a new string which trimmed white spaces from the right\r\n\r\nside of the $str.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">trim($str)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which trimmed white spaces from the left\r\n\r\nand right side of the $str.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 112.063px\" rowspan=\"5\">str_pad($str, $len, [,$pad [,$type] ])\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 28px;width: 142.063px\" rowspan=\"5\">Returns a new string which padded\u00a0 the string $string upto the\r\n\r\nlength $len. By default the $pad is space, but you can specify any\r\n\r\nother character. The padding is by default right. You can select\r\n\r\nleft, right or both for $type by setting the constant\r\n\r\nSTR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 115.063px\">lcfirst($str)<\/td>\r\n<td style=\"height: 28px;width: 98.0625px\">Returns a new string which converts the first letter to lowercase.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 115.063px\">ucfirst($str)<\/td>\r\n<td style=\"height: 28px;width: 98.0625px\">Returns a new string which converts the first letter to uppercase.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">ucwords($str)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which converts the first letter of each word\r\n\r\nto uppercase.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 112.063px\" rowspan=\"2\">strtolower($str)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 28px;width: 86.0625px\" rowspan=\"2\">Returns a new string which converted all the letters of input string\r\n\r\n$str into lower case.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">strtoupper($str)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which converted\u00a0 all the letters of input\r\n\r\nstring $str into upper case.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 112.063px\">strrev($str)<\/td>\r\n<td style=\"height: 28px;width: 142.063px\">Returns a new string in which the sequence of letters is reversed.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">str_shuffle($str)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which shuffle the letters in the string $str\r\n\r\nrandomly.<\/td>\r\n<\/tr>\r\n<tr style=\"height: 28px\">\r\n<td style=\"height: 28px;width: 112.063px\">str_repeat($str, $i)<\/td>\r\n<td style=\"height: 28px;width: 142.063px\">Returns a new string in which string $str is repeated $i times.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&lt;?php\r\n\r\n$name = ' Sunday is a holiday ';\r\n\r\n$olen = strlen($name);\r\n\r\n$ltrim = ltrim($name); \/\/ltrim\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$lltrim = strlen($ltrim);<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original Length of the string $name is : $olen &lt;br&gt; After left-side trimming: $lltrim\";<\/span>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original string after left-trimming is : $ltrim\"; $rtrim = rtrim($name); \/\/rtrim $rtrim = strlen($rtrim);<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original Length of the string $name is : $olen &lt;br&gt; After right-side trimming: $rtrim\";<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$trim = trim($name); \/\/trim<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$trimlen = strlen($trim);<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original Length of the string $name is : $olen &lt;br&gt; After both side trimming: $trimlen\"; $str = \"Virat Kohli\";<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$ans = str_pad($str,25,'*',STR_PAD_BOTH); \/\/str_pad echo \"&lt;br&gt; After both side padding it is:$ans\"; $virat = 'Virat Kohli';<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$lcfirst = lcfirst($virat); \/\/lcfirst<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original : $virat and &lt;br&gt; after lcfirst it is: $lcfirst\"; $sachin = 'sachin Tendulkar';<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$ucfirst = ucfirst($sachin); \/\/ucfirst<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original : $sachin and &lt;br&gt; after ucfisrst it is: $ucfirst\"; $viru = 'virendra sehwag';<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$ucwords = ucwords($name); \/\/ucwords<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original : $viru and &lt;br&gt; after ucwords it is: $ucwords\"; $caps = 'ALL CAPS';<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$strtolower = strtolower($caps); \/\/strtolower<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original : $caps and &lt;br&gt; after strtolower it is: $strtolower\"; $small = 'small case letters';<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"font-size: 1em;text-align: initial\">$strtoupper = strtoupper($small); \/\/strtoupper<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original : $small and &lt;br&gt; after strtoupper it is: $strtoupper\";<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$city = 'Ahmedabad';<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$strrev = strrev($city); \/\/strrev<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original string is: $city and &lt;br&gt; after strrev it is: $strrev\";<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$str = 'string';<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$shuffle = str_shuffle($str);<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original string is: $str and &lt;br&gt; after shuffle it is: $shuffle\";<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$strrepeat = str_repeat($str,4); \/\/str_repeat<\/span><\/p>\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; Original string is: $str and &lt;br&gt; after repeat it 4 times : $strrepeat\";<\/span><span style=\"text-align: initial;font-size: 1em\">?&gt;<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Then the output will be:<\/strong>\r\n\r\n&nbsp;\r\n\r\nOriginal Length of the string Sunday is a holiday is : 22\r\n\r\nAfter left-side trimming: 20\r\n\r\nOriginal string after left-trimming is : Sunday is a holiday\r\n\r\nOriginal Length of the string Sunday is a holiday is : 22\r\n\r\nAfter right-side trimming: 21\r\n\r\nOriginal Length of the string Sunday is a holiday is : 22\r\n\r\nAfter both side trimming: 19\r\n\r\nAfter both side padding it is:*******Virat Kohli*******\r\n\r\nOriginal : Virat Kohli and\r\n\r\nafter lcfirst it is: virat Kohli\r\n\r\nOriginal : sachin Tendulkar and\r\n\r\nafter ucfisrst it is: Sachin Tendulkar\r\n\r\nOriginal : virendra sehwag and\r\n\r\nafter ucwords it is: Sunday Is A Holiday\r\n\r\nOriginal : ALL CAPS and\r\n\r\nafter strtolower it is: all caps\r\n\r\nOriginal : small case letters and\r\n\r\nafter strtoupper it is: SMALL CASE LETTERS\r\n\r\nOriginal string is: Ahmedabad and\r\n\r\nafter strrev it is: dabademhA\r\n\r\nOriginal string is: string and\r\n\r\nafter shuffle it is: ringts\r\n\r\n<span style=\"font-size: 1em;text-align: initial\">Original string is: string and<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">after repeat it 4 times : stringstringstringstring<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Functions that convert between strings and arrays<\/strong>\r\n\r\n&nbsp;\r\n<table class=\"aligncenter\" border=\"1\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 126.063px\"><strong>Function<\/strong><\/td>\r\n<td style=\"width: 354.063px\"><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 126.063px\" rowspan=\"4\">explode($sep, $str)\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;<\/td>\r\n<td style=\"width: 354.063px\" rowspan=\"4\">Returns an array of string which are separated in\r\n\r\n$str by delimeter $sep. The delimeter $sep can be\r\n\r\nany length. If $str is an empty string, each string in\r\n\r\nan array consist of single letter.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 126.063px\" rowspan=\"2\">implode($sep, $sa)\r\n\r\n&nbsp;<\/td>\r\n<td style=\"width: 354.063px\" rowspan=\"2\">Returns a string that results from joining the\r\n\r\nelements of array $sa with the $sep string.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&lt;?php\r\n\r\n\/\/explode\r\n\r\n$email = 'abc.def@ghi.com,jkl.mno@pqr.com,stu.uvw@xyz.com'; $e = explode(',',$email);\r\n\r\necho \"&lt;br&gt; After explode the emails are :\";\r\n\r\nforeach($e as $v)\r\n\r\n{\r\n\r\necho \"&lt;br&gt; $v\";\r\n\r\n}\r\n\r\n\/\/implode\r\n\r\n$i = implode('|',$e);\r\n\r\necho \"&lt;br&gt; After emplode the elements of email array becomes a string:\";\r\n\r\necho \"&lt;br&gt; $i\";\r\n\r\n?&gt;\r\n\r\n&nbsp;\r\n\r\n<strong>The output will be:<\/strong>\r\n\r\n&nbsp;\r\n\r\nAfter explode the emails are :\r\n\r\nabc.def@ghi.com\r\n\r\njkl.mno@pqr.com\r\n\r\nstu.uvw@xyz.com\r\n\r\n<\/div>\r\n<div>\r\n\r\n\u00a0 \u00a0 After implode the elements of email array becomes a string:\r\n\r\nabc.def@ghi.com|jkl.mno@pqr.com|stu.uvw@xyz.com\r\n\r\n&nbsp;\r\n\r\n<strong>Functions that convert between strings and ascii integer values<\/strong>\r\n\r\n&nbsp;\r\n<table class=\"aligncenter\" style=\"height: 90px\" border=\"1\" width=\"578\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 99.0625px\"><strong>Function<\/strong><\/td>\r\n<td style=\"width: 450.063px\"><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 99.0625px\">chr($val)<\/td>\r\n<td style=\"width: 450.063px\">Return a string which to ASCII character of input value<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 99.0625px\">ord($string)<\/td>\r\n<td style=\"width: 450.063px\">Return a string convert to ASCII value of input string<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&lt;?php\r\n\r\n$chr = chr(72);\r\n\r\necho \"&lt;br&gt; The ASCII character for value 72 is: $chr\"; $ord = ord('H');\r\n\r\necho \"&lt;br&gt; The integer value for the character H is: $ord\"; ?&gt;\r\n\r\n&nbsp;\r\n\r\n<strong>The output is:<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe ASCII character for value 72 is: H\r\n\r\nThe integer value for the character H is: 72\r\n\r\n&nbsp;\r\n\r\n<strong>Functions for compare two strings<\/strong>\r\n\r\n&nbsp;\r\n<table class=\"aligncenter\" border=\"1\">\r\n<tbody>\r\n<tr>\r\n<td><strong>Function<\/strong><\/td>\r\n<td><strong>Description<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td rowspan=\"7\">strcmp($str1, $str2)\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;<\/td>\r\n<td rowspan=\"7\">It compares two strings and return an integer value which\r\n\r\nspecifies their sequence. If the function returns\r\n\r\n-1: $str1 comes before $str2\r\n\r\n1:$str1 comes after $str2\r\n\r\n0:$str1 and $str2 are the same\r\n\r\nThis\u00a0 comparison\u00a0 is\u00a0 case\u00a0 sensitive.\u00a0 Hence\u00a0 Capital\u00a0 letter\r\n\r\ncomes before small case letters.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>strcasecmp($str1, $str2)<\/td>\r\n<td>Case-insensitive version of strcmp function<\/td>\r\n<\/tr>\r\n<tr>\r\n<td rowspan=\"3\">strnatcmp($str1,$str2)\r\n\r\n&nbsp;\r\n\r\n&nbsp;<\/td>\r\n<td rowspan=\"3\">Same\u00a0 as\u00a0 strcmp\u00a0 function.\u00a0 The\u00a0 only\u00a0 difference\u00a0 is\u00a0 that\u00a0 the\r\n\r\nfunction makes \u201cnatural\u201d comparison for numbers of\u00a0\u00a0 $str1\r\n\r\nand $str2<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>strnatcasecmp($str1, $str2)<\/td>\r\n<td>Case-insensitive version of strnatcmp function.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&lt;?php\r\n\r\n$result1 = strcmp('Anand','Zarna');\r\n\r\necho \"&lt;br&gt; $result1\";\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$result2 = strcmp('Anand','zarna');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; $result2\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$result3 = strcasecmp('Anand','zarna');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; $result3\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$result4 = strcmp('img03','img10');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; $result4\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$result5 = strcmp('img3','img10');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; $result5\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">$result6 = strnatcmp('img3','img10');<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">echo \"&lt;br&gt; $result6\";<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">?&gt;<\/span>\r\n\r\n<\/div>\r\n&nbsp;\r\n\r\n<strong>The output will be:<\/strong>\r\n\r\n&nbsp;\r\n\r\n-1\r\n\r\n-1\r\n\r\n-25\r\n\r\n-1\r\n\r\n1\r\n\r\n-1\r\n\r\n&nbsp;\r\n\r\nYou can find many strings functions at\r\n\r\n&nbsp;\r\n\r\n<a href=\"http:\/\/www.php.net\/manual\/en\/ref.strings.php\">http:\/\/www.php.net\/manual\/en\/ref.strings.php<\/a>\r\n\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td><strong>you can view video on Strings with PHP<\/strong><\/td>\r\n<td><a href=\"https:\/\/youtu.be\/WPCOPu3ge00\" target=\"_blank\" rel=\"noopener\"><img class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n\r\n\r\n<strong>References:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">1. Luke Welling, Laura Thomson: PHP and MySQL Web Development, Pearson,<\/p>\r\n<p style=\"text-align: justify\">2. W. Jason Gilmore: Beginning PHP and MySQL 5 From Novice to Professional, Apress<\/p>\r\n<p style=\"text-align: justify\">3. Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass:Beginning PHP5, Apache, and MySQL Web Development, Wrox,<\/p>\r\n<p style=\"text-align: justify\">4. Robin Nixon: Learning PHP, MySQL, and JavaScript, O'Reilly Media<\/p>\r\n<p style=\"text-align: justify\">5. Ed Lecky-Thompson, Heow Eide-Goodman, Steven D. Nowicki, Alec Cove: Professional PHP,Wrox<\/p>\r\n<p style=\"text-align: justify\">6. Tim Converse, Joyce Park, Clark Morgan: PHP5 and MySQL Bible<\/p>\r\n<p style=\"text-align: justify\">7. Joel Murach, Ray Harris: Murach\u2019s PHP and MySQL, Shroff\/Murach<\/p>\r\n<p style=\"text-align: justify\">8. Ivan Bayross, Web Enabled Commercial Application Development Using HTML\/Javascript\/DHTML\/PHP , BPB Publications<\/p>\r\n<p style=\"text-align: justify\">9. Julie C. Meloni, Sams Teach Yourself PHP, MySQL and Apache All in One, Sams<\/p>\r\n<p style=\"text-align: justify\">10. Larry Ullman, PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Pearson Education<\/p>\r\n<p style=\"text-align: justify\">11. http:\/\/www.php.net<\/p>\r\n<p style=\"text-align: justify\">12. http:\/\/www.w3schools.com\/<\/p>\r\n13. http:\/\/www.tutorialspoint.com\/","rendered":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/WPCOPu3ge00\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a><br \/>\n<\/span><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Strings<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">As the HTML form submitted data received by server as string, string is an important part of PHP application. Strings can be used single quotes or double quotes. When string is created using double quotes, then PHP engine perform variable substitution. Variable substitution means variable name is replace by the variable value. When variable name is replace by variable value at that if necessary PHP converts the variable value into string. The conversion of variable value into string is known as interpolation.<\/p>\n<p>&nbsp;<\/p>\n<p>Let us understand it by an example.<\/p>\n<p>$count = 3;<\/p>\n<p>$item = &#8220;Ice Cream&#8221;;<\/p>\n<p>$msg1 = &#8220;I have $count $item.&#8221;;<\/p>\n<p>$msg2 = &#8220;I have $count $items.&#8221;;<\/p>\n<p>$msg3 = &#8220;I have $count $item s.&#8221;;<\/p>\n<p>$msg4 = &#8220;I have $count ${item}s.&#8221;;<\/p>\n<p>echo &#8220;&lt;br&gt; Message 1 : $msg1&#8221;;<\/p>\n<p>echo &#8220;&lt;br&gt; Message 2 : $msg2&#8221;;<\/p>\n<p>echo &#8220;&lt;br&gt; Message 3 : $msg3&#8221;;<\/p>\n<p>echo &#8220;&lt;br&gt; Message 4 : $msg4&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>The curly braces { } is used to separate variable name with text shown\u00a0 in $msg4.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Escape Sequence with String<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The escape sequence behave differently for single quote and double quotes.<\/p>\n<p>The \\\u00a0\u00a0\u00a0 (read as back slash) works for single quote and double quotes.<\/p>\n<p>&nbsp;<\/p>\n<p>For example:<\/p>\n<p>&nbsp;<\/p>\n<p>$dir1 = &#8216;H:\\wamp\\www\\PGWAD&#8217;;<\/p>\n<p>echo &#8220;&lt;br&gt; $dir1&#8221;;<\/p>\n<p>$dir2 = &#8216;H:\\\\wamp\\\\www\\\\PGWAD&#8217;;<\/p>\n<p>echo &#8220;&lt;br&gt; $dir2&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>$music = &#8216;Meet \\&#8217;s Music Store&#8217;;<\/p>\n<p>echo &#8220;&lt;br&gt; $music&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>$newmusic = &#8220;Meet&#8217;s Music Store&#8221;;<\/p>\n<p>echo &#8220;&lt;br&gt; $newmusic&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>$demo = &#8220;He said it costs $12&#8221;;<\/p>\n<p>echo &#8220;&lt;br&gt; $demo&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>Then the output for the following is:<\/p>\n<\/div>\n<div>\n<p>\u00a0 \u00a0 H:\\wamp\\www\\PGWAD<\/p>\n<p>H:\\wamp\\www\\PGWAD<\/p>\n<p>Meet &#8216;s Music Store<\/p>\n<p>Meet&#8217;s Music Store<\/p>\n<p>He said it costs $12<\/p>\n<p>&nbsp;<\/p>\n<p><strong>In-Built useful String Functions<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">PHP provides many built in functions. Below is the list of various types of string functions provided by PHP.<\/p>\n<ul>\n<li>Function for working with string length<\/li>\n<li>Functions that search a string<\/li>\n<li>Functions that replace part of a string<\/li>\n<li>Functions that modify the strings<\/li>\n<li style=\"text-align: justify\">Functions that convert between strings and arrays<\/li>\n<li>Functions that convert between strings and ASCII integer values<\/li>\n<li>Functions for compare two strings<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Functions for working with string length and substrings<\/strong><\/p>\n<p>&nbsp;<\/p>\n<table class=\"aligncenter\" style=\"height: 52px\">\n<tbody>\n<tr style=\"height: 14px\">\n<td style=\"width: 141.063px;height: 14px\"><strong>Function<\/strong><\/td>\n<td style=\"width: 430.063px;height: 14px\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 14px\">\n<td style=\"width: 141.063px;height: 14px\">empty($str)<\/td>\n<td style=\"width: 430.063px;height: 14px\">Returns true if $str is empty(\u201c\u201d), a Null Value or \u201c0\u201d.<\/td>\n<\/tr>\n<tr style=\"height: 14px\">\n<td style=\"width: 141.063px;height: 14px\">strlen($str)<\/td>\n<td style=\"width: 430.063px;height: 14px\">Retruns the length of the string $str.<\/td>\n<\/tr>\n<tr style=\"height: 10px\">\n<td style=\"width: 141.063px;height: 10px\" rowspan=\"4\">substr($str, $i[, $len])<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/td>\n<td style=\"width: 430.063px;height: 10px\" rowspan=\"4\">Retruns substring from the string $str. $i is used to make start<\/p>\n<p>position for substring $str. $len is used to determine length. If<\/p>\n<p>$len is omitted, then the string starts from $i to the end of the<\/p>\n<p>string $str. The first character is at 0th position.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>\/\/empty<\/p>\n<p>$phone = 9876543210;<\/p>\n<p>if(empty($phone))<\/p>\n<p>{<\/p>\n<p>echo &#8220;&lt;br&gt; phone is not set&#8221;;<\/p>\n<p>}<\/p>\n<p>else<\/p>\n<p>{<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; phone is set: $phone&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">}<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">\/\/strlen<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$str = &#8220;Hiren Joshi&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$len = strlen($str);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; The length of string $str is :$len&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">\/\/substr<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$sub = substr($str,6,5);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; The substring of $str is $sub&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">?&gt;<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>The output will be:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>phone is set: 9876543210<\/p>\n<p>The length of string Hiren Joshi is :11<\/p>\n<p>The substring of Hiren Joshi is Joshi<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Functions that search a string<\/strong><\/p>\n<p>&nbsp;<\/p>\n<table class=\"aligncenter\">\n<tbody>\n<tr>\n<td style=\"width: 198.063px\"><strong>Function<\/strong><\/td>\n<td style=\"width: 441.063px\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 198.063px\" rowspan=\"4\">Strpos($str1, $str2 [,$offset])<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/td>\n<td style=\"width: 441.063px\" rowspan=\"4\">Search\u00a0 the first occurrence of $str2 in $str1. If found then<\/p>\n<p>returns integer number of the first occurrence.\u00a0 The optional<\/p>\n<p>$offset helps to determine start position for occurrence of $str1<\/p>\n<p>in $str1.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 198.063px\">Stripos($str1, $str2 [,$offset])<\/td>\n<td style=\"width: 441.063px\">Case in-sensitive version of strops function.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 198.063px\" rowspan=\"2\">Strrpos($str1, $str2 [,$offset])<\/p>\n<p>&nbsp;<\/td>\n<td style=\"width: 441.063px\" rowspan=\"2\">Same as strops except it statrt searching from the end of the<\/p>\n<p>string to the start of the string.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 198.063px\">Strtipos($str1, $str2 [,$offset])<\/td>\n<td style=\"width: 441.063px\">Case in-sensitive version of strrpos function.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>\/\/strpos<\/p>\n<p>$str = &#8220;Hiren Joshi&#8221;;<\/p>\n<p>$pos = strpos($str,&#8217;h&#8217;);<\/p>\n<p>echo &#8220;&lt;br&gt; character h is found at position (strpos): $pos&#8221;; \/\/stripos<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$ipos = stripos($str,&#8217;h&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; character h is found at position (stripos): $ipos&#8221;; \/\/strrpos<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$rpos = strrpos($str,&#8217;h&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; character h is found at position (strrpos): $rpos&#8221;; \/\/strripos<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$ripos = strripos($str,&#8217;h&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; character h is found at position(strripos): $ripos&#8221;; \/\/offset<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$without = stripos($str,&#8221;h&#8221;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; character h is found at position( without offset strripos): $without&#8221;; $offset = stripos($str,&#8221;h&#8221;,1);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; character h is found at position( with offset strripos): $offset&#8221;; ?&gt;<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>The output will be:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>character h is found at position (strpos): 9<\/p>\n<p>character h is found at position (stripos): 0<\/p>\n<p>character h is found at position (strrpos): 9<\/p>\n<p>character h is found at position(strripos): 9<\/p>\n<p>character h is found at position( without offset strripos): 0<\/p>\n<p>character h is found at position( with offset strripos): 9<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Functions that replace part of a string<\/strong><\/p>\n<p>&nbsp;<\/p>\n<table class=\"aligncenter\">\n<tbody>\n<tr>\n<td><strong>Function<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>str_replace($str1, $new, $str2)<\/td>\n<td>Return a new string which replace $str with $new in $str2.<\/td>\n<\/tr>\n<tr>\n<td>str_ireplace($str1, $new, $str2)<\/td>\n<td>Case-insensitive version of str_replace function.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>$str = &#8220;Hello Rohit&#8221;;<\/p>\n<p>$ans =str_replace(&#8220;Hello&#8221;,&#8221;Hi!&#8221;,$str);<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original string is $str &lt;br&gt; replaced with $ans&#8221;; $irep = str_ireplace(&#8220;r&#8221;,&#8221;M&#8221;,$str);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original string is $str &lt;br&gt; replaced with $irep&#8221;; ?&gt;<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Program output is:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Original string is Hello Rohit<\/p>\n<p>replaced with Hi! Rohit<\/p>\n<p>Original string is Hello Rohit<\/p>\n<p>replaced with Hello Mohit<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Functions that modify the strings<\/strong><\/p>\n<p>&nbsp;<\/p>\n<table class=\"aligncenter\" style=\"height: 863px; width: 750px;\">\n<tbody>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 115.063px\"><strong>Function<\/strong><\/td>\n<td style=\"height: 28px;width: 98.0625px\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 0px\">\n<td style=\"height: 57px;width: 115.063px\" rowspan=\"2\">ltrim($str)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 57px;width: 98.0625px\" rowspan=\"2\">Return a new string which trimmed white spaces from the left<\/p>\n<p>side of the $str.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 112.063px\" rowspan=\"2\">rtrim($str)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 28px;width: 142.063px\" rowspan=\"2\">Return a new string which trimmed white spaces from the right<\/p>\n<p>side of the $str.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">trim($str)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which trimmed white spaces from the left<\/p>\n<p>and right side of the $str.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 112.063px\" rowspan=\"5\">str_pad($str, $len, [,$pad [,$type] ])<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 28px;width: 142.063px\" rowspan=\"5\">Returns a new string which padded\u00a0 the string $string upto the<\/p>\n<p>length $len. By default the $pad is space, but you can specify any<\/p>\n<p>other character. The padding is by default right. You can select<\/p>\n<p>left, right or both for $type by setting the constant<\/p>\n<p>STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 115.063px\">lcfirst($str)<\/td>\n<td style=\"height: 28px;width: 98.0625px\">Returns a new string which converts the first letter to lowercase.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 115.063px\">ucfirst($str)<\/td>\n<td style=\"height: 28px;width: 98.0625px\">Returns a new string which converts the first letter to uppercase.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">ucwords($str)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which converts the first letter of each word<\/p>\n<p>to uppercase.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 112.063px\" rowspan=\"2\">strtolower($str)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 28px;width: 86.0625px\" rowspan=\"2\">Returns a new string which converted all the letters of input string<\/p>\n<p>$str into lower case.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">strtoupper($str)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which converted\u00a0 all the letters of input<\/p>\n<p>string $str into upper case.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 112.063px\">strrev($str)<\/td>\n<td style=\"height: 28px;width: 142.063px\">Returns a new string in which the sequence of letters is reversed.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 115.063px\" rowspan=\"2\">str_shuffle($str)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"height: 28px;width: 98.0625px\" rowspan=\"2\">Returns a new string which shuffle the letters in the string $str<\/p>\n<p>randomly.<\/td>\n<\/tr>\n<tr style=\"height: 28px\">\n<td style=\"height: 28px;width: 112.063px\">str_repeat($str, $i)<\/td>\n<td style=\"height: 28px;width: 142.063px\">Returns a new string in which string $str is repeated $i times.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>$name = &#8216; Sunday is a holiday &#8216;;<\/p>\n<p>$olen = strlen($name);<\/p>\n<p>$ltrim = ltrim($name); \/\/ltrim<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$lltrim = strlen($ltrim);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original Length of the string $name is : $olen &lt;br&gt; After left-side trimming: $lltrim&#8221;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original string after left-trimming is : $ltrim&#8221;; $rtrim = rtrim($name); \/\/rtrim $rtrim = strlen($rtrim);<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original Length of the string $name is : $olen &lt;br&gt; After right-side trimming: $rtrim&#8221;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$trim = trim($name); \/\/trim<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$trimlen = strlen($trim);<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original Length of the string $name is : $olen &lt;br&gt; After both side trimming: $trimlen&#8221;; $str = &#8220;Virat Kohli&#8221;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$ans = str_pad($str,25,&#8217;*&#8217;,STR_PAD_BOTH); \/\/str_pad echo &#8220;&lt;br&gt; After both side padding it is:$ans&#8221;; $virat = &#8216;Virat Kohli&#8217;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$lcfirst = lcfirst($virat); \/\/lcfirst<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original : $virat and &lt;br&gt; after lcfirst it is: $lcfirst&#8221;; $sachin = &#8216;sachin Tendulkar&#8217;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$ucfirst = ucfirst($sachin); \/\/ucfirst<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original : $sachin and &lt;br&gt; after ucfisrst it is: $ucfirst&#8221;; $viru = &#8216;virendra sehwag&#8217;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$ucwords = ucwords($name); \/\/ucwords<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original : $viru and &lt;br&gt; after ucwords it is: $ucwords&#8221;; $caps = &#8216;ALL CAPS&#8217;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$strtolower = strtolower($caps); \/\/strtolower<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original : $caps and &lt;br&gt; after strtolower it is: $strtolower&#8221;; $small = &#8216;small case letters&#8217;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"font-size: 1em;text-align: initial\">$strtoupper = strtoupper($small); \/\/strtoupper<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original : $small and &lt;br&gt; after strtoupper it is: $strtoupper&#8221;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$city = &#8216;Ahmedabad&#8217;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$strrev = strrev($city); \/\/strrev<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original string is: $city and &lt;br&gt; after strrev it is: $strrev&#8221;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$str = &#8216;string&#8217;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$shuffle = str_shuffle($str);<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original string is: $str and &lt;br&gt; after shuffle it is: $shuffle&#8221;;<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">$strrepeat = str_repeat($str,4); \/\/str_repeat<\/span><\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; Original string is: $str and &lt;br&gt; after repeat it 4 times : $strrepeat&#8221;;<\/span><span style=\"text-align: initial;font-size: 1em\">?&gt;<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Then the output will be:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Original Length of the string Sunday is a holiday is : 22<\/p>\n<p>After left-side trimming: 20<\/p>\n<p>Original string after left-trimming is : Sunday is a holiday<\/p>\n<p>Original Length of the string Sunday is a holiday is : 22<\/p>\n<p>After right-side trimming: 21<\/p>\n<p>Original Length of the string Sunday is a holiday is : 22<\/p>\n<p>After both side trimming: 19<\/p>\n<p>After both side padding it is:*******Virat Kohli*******<\/p>\n<p>Original : Virat Kohli and<\/p>\n<p>after lcfirst it is: virat Kohli<\/p>\n<p>Original : sachin Tendulkar and<\/p>\n<p>after ucfisrst it is: Sachin Tendulkar<\/p>\n<p>Original : virendra sehwag and<\/p>\n<p>after ucwords it is: Sunday Is A Holiday<\/p>\n<p>Original : ALL CAPS and<\/p>\n<p>after strtolower it is: all caps<\/p>\n<p>Original : small case letters and<\/p>\n<p>after strtoupper it is: SMALL CASE LETTERS<\/p>\n<p>Original string is: Ahmedabad and<\/p>\n<p>after strrev it is: dabademhA<\/p>\n<p>Original string is: string and<\/p>\n<p>after shuffle it is: ringts<\/p>\n<p><span style=\"font-size: 1em;text-align: initial\">Original string is: string and<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">after repeat it 4 times : stringstringstringstring<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Functions that convert between strings and arrays<\/strong><\/p>\n<p>&nbsp;<\/p>\n<table class=\"aligncenter\">\n<tbody>\n<tr>\n<td style=\"width: 126.063px\"><strong>Function<\/strong><\/td>\n<td style=\"width: 354.063px\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 126.063px\" rowspan=\"4\">explode($sep, $str)<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/td>\n<td style=\"width: 354.063px\" rowspan=\"4\">Returns an array of string which are separated in<\/p>\n<p>$str by delimeter $sep. The delimeter $sep can be<\/p>\n<p>any length. If $str is an empty string, each string in<\/p>\n<p>an array consist of single letter.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 126.063px\" rowspan=\"2\">implode($sep, $sa)<\/p>\n<p>&nbsp;<\/td>\n<td style=\"width: 354.063px\" rowspan=\"2\">Returns a string that results from joining the<\/p>\n<p>elements of array $sa with the $sep string.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>\/\/explode<\/p>\n<p>$email = &#8216;abc.def@ghi.com,jkl.mno@pqr.com,stu.uvw@xyz.com&#8217;; $e = explode(&#8216;,&#8217;,$email);<\/p>\n<p>echo &#8220;&lt;br&gt; After explode the emails are :&#8221;;<\/p>\n<p>foreach($e as $v)<\/p>\n<p>{<\/p>\n<p>echo &#8220;&lt;br&gt; $v&#8221;;<\/p>\n<p>}<\/p>\n<p>\/\/implode<\/p>\n<p>$i = implode(&#8216;|&#8217;,$e);<\/p>\n<p>echo &#8220;&lt;br&gt; After emplode the elements of email array becomes a string:&#8221;;<\/p>\n<p>echo &#8220;&lt;br&gt; $i&#8221;;<\/p>\n<p>?&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>The output will be:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>After explode the emails are :<\/p>\n<p>abc.def@ghi.com<\/p>\n<p>jkl.mno@pqr.com<\/p>\n<p>stu.uvw@xyz.com<\/p>\n<\/div>\n<div>\n<p>\u00a0 \u00a0 After implode the elements of email array becomes a string:<\/p>\n<p>abc.def@ghi.com|jkl.mno@pqr.com|stu.uvw@xyz.com<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Functions that convert between strings and ascii integer values<\/strong><\/p>\n<p>&nbsp;<\/p>\n<table class=\"aligncenter\" style=\"height: 90px; width: 578px;\">\n<tbody>\n<tr>\n<td style=\"width: 99.0625px\"><strong>Function<\/strong><\/td>\n<td style=\"width: 450.063px\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 99.0625px\">chr($val)<\/td>\n<td style=\"width: 450.063px\">Return a string which to ASCII character of input value<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 99.0625px\">ord($string)<\/td>\n<td style=\"width: 450.063px\">Return a string convert to ASCII value of input string<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>$chr = chr(72);<\/p>\n<p>echo &#8220;&lt;br&gt; The ASCII character for value 72 is: $chr&#8221;; $ord = ord(&#8216;H&#8217;);<\/p>\n<p>echo &#8220;&lt;br&gt; The integer value for the character H is: $ord&#8221;; ?&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>The output is:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The ASCII character for value 72 is: H<\/p>\n<p>The integer value for the character H is: 72<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Functions for compare two strings<\/strong><\/p>\n<p>&nbsp;<\/p>\n<table class=\"aligncenter\">\n<tbody>\n<tr>\n<td><strong>Function<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td rowspan=\"7\">strcmp($str1, $str2)<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/td>\n<td rowspan=\"7\">It compares two strings and return an integer value which<\/p>\n<p>specifies their sequence. If the function returns<\/p>\n<p>-1: $str1 comes before $str2<\/p>\n<p>1:$str1 comes after $str2<\/p>\n<p>0:$str1 and $str2 are the same<\/p>\n<p>This\u00a0 comparison\u00a0 is\u00a0 case\u00a0 sensitive.\u00a0 Hence\u00a0 Capital\u00a0 letter<\/p>\n<p>comes before small case letters.<\/td>\n<\/tr>\n<tr>\n<td>strcasecmp($str1, $str2)<\/td>\n<td>Case-insensitive version of strcmp function<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"3\">strnatcmp($str1,$str2)<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/td>\n<td rowspan=\"3\">Same\u00a0 as\u00a0 strcmp\u00a0 function.\u00a0 The\u00a0 only\u00a0 difference\u00a0 is\u00a0 that\u00a0 the<\/p>\n<p>function makes \u201cnatural\u201d comparison for numbers of\u00a0\u00a0 $str1<\/p>\n<p>and $str2<\/td>\n<\/tr>\n<tr>\n<td>strnatcasecmp($str1, $str2)<\/td>\n<td>Case-insensitive version of strnatcmp function.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>$result1 = strcmp(&#8216;Anand&#8217;,&#8217;Zarna&#8217;);<\/p>\n<p>echo &#8220;&lt;br&gt; $result1&#8221;;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$result2 = strcmp(&#8216;Anand&#8217;,&#8217;zarna&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; $result2&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$result3 = strcasecmp(&#8216;Anand&#8217;,&#8217;zarna&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; $result3&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$result4 = strcmp(&#8216;img03&#8242;,&#8217;img10&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; $result4&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$result5 = strcmp(&#8216;img3&#8242;,&#8217;img10&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; $result5&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">$result6 = strnatcmp(&#8216;img3&#8242;,&#8217;img10&#8217;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">echo &#8220;&lt;br&gt; $result6&#8221;;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">?&gt;<\/span><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p><strong>The output will be:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>-1<\/p>\n<p>-1<\/p>\n<p>-25<\/p>\n<p>-1<\/p>\n<p>1<\/p>\n<p>-1<\/p>\n<p>&nbsp;<\/p>\n<p>You can find many strings functions at<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/www.php.net\/manual\/en\/ref.strings.php\">http:\/\/www.php.net\/manual\/en\/ref.strings.php<\/a><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>you can view video on Strings with PHP<\/strong><\/td>\n<td><a href=\"https:\/\/youtu.be\/WPCOPu3ge00\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>References:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">1. Luke Welling, Laura Thomson: PHP and MySQL Web Development, Pearson,<\/p>\n<p style=\"text-align: justify\">2. W. Jason Gilmore: Beginning PHP and MySQL 5 From Novice to Professional, Apress<\/p>\n<p style=\"text-align: justify\">3. Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass:Beginning PHP5, Apache, and MySQL Web Development, Wrox,<\/p>\n<p style=\"text-align: justify\">4. Robin Nixon: Learning PHP, MySQL, and JavaScript, O&#8217;Reilly Media<\/p>\n<p style=\"text-align: justify\">5. Ed Lecky-Thompson, Heow Eide-Goodman, Steven D. Nowicki, Alec Cove: Professional PHP,Wrox<\/p>\n<p style=\"text-align: justify\">6. Tim Converse, Joyce Park, Clark Morgan: PHP5 and MySQL Bible<\/p>\n<p style=\"text-align: justify\">7. Joel Murach, Ray Harris: Murach\u2019s PHP and MySQL, Shroff\/Murach<\/p>\n<p style=\"text-align: justify\">8. Ivan Bayross, Web Enabled Commercial Application Development Using HTML\/Javascript\/DHTML\/PHP , BPB Publications<\/p>\n<p style=\"text-align: justify\">9. Julie C. Meloni, Sams Teach Yourself PHP, MySQL and Apache All in One, Sams<\/p>\n<p style=\"text-align: justify\">10. Larry Ullman, PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Pearson Education<\/p>\n<p style=\"text-align: justify\">11. http:\/\/www.php.net<\/p>\n<p style=\"text-align: justify\">12. http:\/\/www.w3schools.com\/<\/p>\n<p>13. http:\/\/www.tutorialspoint.com\/<\/p>\n","protected":false},"author":3,"menu_order":14,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-hiren-joshi"],"pb_section_license":""},"chapter-type":[],"contributor":[59],"license":[],"class_list":["post-169","chapter","type-chapter","status-publish","hentry","contributor-dr-hiren-joshi"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/pressbooks\/v2\/chapters\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":7,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/pressbooks\/v2\/chapters\/169\/revisions"}],"predecessor-version":[{"id":493,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/pressbooks\/v2\/chapters\/169\/revisions\/493"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/pressbooks\/v2\/chapters\/169\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/wp\/v2\/media?parent=169"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/pressbooks\/v2\/chapter-type?post=169"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/wp\/v2\/contributor?post=169"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp9\/wp-json\/wp\/v2\/license?post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}