PHP string ltrim() functionPHP string ltrim() function is predefined function. It is often used to remove whitespace from both sides of a string or other character from the left side of a string. Syntax:
Example 1Output: Without ltrim() Function: Hello PHP! With ltrim() function : Hello PHP! Example 2Output: Without ltrim() Function: Hello PHP Javatpoint! With ltrim() function: Hello PHP Javatpoint! Example 3Output: Without ltrim(): Hello World! With ltrim: Hello World! Note: To remove newlines from the left side of a string then we can use (\n):Next TopicPHP String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India