Read Php Easily

Page 79

V

STRINGS IN PHP

PHP

INDIA:HYDRABAD/ INDIA:CHENNI/ INDIA:/DELHI/ trim() The trim() function is used to remove the white spaces from both sides of a string. This function was introduced in PHP3. Example: <?php $text = “\t\t We are using trim :) ... “; $trimed = trim($text); echo $trimed.”<br>”; $trimed = trim($text,” \t.”); echo $trimed.”<br>”; ?> The output of the above program is as follows: We are using trim :) ... We are using trim :)

78

FAST TRACK

www.thinkdigit.com


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.