• PHP Video Tutorials

PHP - Function Ltrim



Syntax

string ltrim ( string $str [, string $character_mask ] )

Definition and Usage

It used to strip whitespace or other characters from the beginning of a string

Return Values

It returns a string with whitespace stripped from the beginning of str.

Parameters

Sr.No Parameters & Description
1

str

It contains the information about string input

2

character_mask

You can also specify the characters you want to strip

Example

Try out the following example

<?php
   $str = "tutorials point!";
   
   echo $str . "<br>";
   echo ltrim($str,"simply easy learning");
?>

This will produce following result −

tutorials point!
tutorials point!
php_function_reference.htm
Advertisements