ltrim() function strips whitespace and other characters from the beginning of a string
ltrim() function ஒரு string-ன் ஆரம்பத்தில் உள்ள whitespaces மற்றும் மற்ற characters-ஐ remove செய்வதற்கு பயன்படுகிறது.
ltrim() Function in PHP
ltrim() function ஒரு string-ன் ஆரம்பத்தில் உள்ள whitespaces மற்றும் மற்ற characters-ஐ remove செய்வதற்கு பயன்படுகிறது.
ltrim(string, strip_characters)
Example1
<?php
$str = " lion is my favourite animal";
echo ltrim($str);
?>
மேலே உள்ள Example1-ஐ கவனிக்கவும் $str என்ற variable-இல் " lion is my favourite animal" இந்த string-இன் ஆரம்பத்தில் whitespaces உள்ளது. ltrim function-இல் இதனை arugument-ஆக அனுப்பும் போது string-ன் ஆரம்பத்தில் உள்ள whitespaces remove செய்கிறது.
lion is my favourite animal
Example2
<?php
$input = " ++--please visit linto.in website to learn programming in tamil";
echo ltrim($input," ++--");
?>
மேலே உள்ள Example2-ஐ கவனிக்கவும் $input என்ற variable-இல் string-இன் ஆரம்பத்தில் whitespaces மற்றும் ++-- போன்ற character சேர்ந்து வந்துள்ளது. இங்கு முக்கியமாக இரண்டாவது argument-இல் ( ++--) அனுபப்படுகிறது. எனவே இங்கு whitespaces மற்றும் ++-- போன்ற character-கள் remove செய்து please visit linto.in website to learn programming in tamil என்ற string மட்டும் output-ஆக கிடைக்கிறது.
please visit linto.in website to learn programming in tamil