PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I remove space from the start of a PHP string?


If you want to do this then it's easy with the Ltrim function - note the 'L' for left at the start of that.

Here is a very simple example which is all you need to understand and how to apply this particular PHP function:

<?php
$text 
"   Give me some space";

echo 
"<" ltrim($text) . ">";
//prints: <Give me some space>
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More strings PHP Questions

How do I calculate the metaphone of a string?

How do I make the first letter of each word upper case?

How do I extract the values of variables from a string?

How can I remove spaces from around a string value?

How do I reverse a string in PHP?



Custom Search