Friday, April 28, 2017

trim, ltrim, rtrim examples

<?php
    echo rtrim('hello php', 'php') . '<br/>';
    echo ltrim('hello php', 'hello') . '<br/>';
    echo trim('hello php', 'hello') . '<br/>';
    echo trim('hello php', 'php') . '<br/>'; 
?>
Output:
hello 
php
php
ello 

No comments:

Post a Comment

here docs

$x = <<<THE_END PHP stands for "PHP: Hypertext Preprocessor". The acronym "PHP" is therefore, usually referre...