chop()

WE can remove white space at the end of the string by using chop function. Here is an example.
echo chop("welcome to plus2net  ");
You can see at the end we left one blank space, that will be removed by using chop function. However to indentify the removal of white space we will add one more string and check like this.
$str="Welcome to plus2net  ";
//echo $str;
echo chop($str);
echo "Thanks";
The output is here
Welcome to plus2netThanks
In the above code we can check the difference by un-commenting 2nd line and adding the comment to third line. We will see the gap before the word Thanks
Welcome to plus2net Thanks
Other than white space we can also remove these .
"\0"-ASCII 0, null
"\t" Tab
"\r" carriage return
"\n" new line
"\x0B" vertical tab
" " white space

Subscribe to our mailing list

* indicates required
Subscribe to plus2net
Your Rating


Google+

PHP String Functions

Post Comment This is for short comments only. Use the forum for more discussions.




Subscribe to our mailing list

* indicates required
Subscribe to plus2net
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2017 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer