rtrim() function strips whitespace and other characters from the end of a string.
rtrim() function ஒரு string-ன் இறுதியில் உள்ள whitespaces மற்றும் மற்ற characters-ஐ remove செய்வதற்கு பயன்படுகிறது.
rtrim() Function in PHP
rtrim() function ஒரு string-ன் இறுதியில் உள்ள whitespaces மற்றும் மற்ற characters-ஐ remove செய்வதற்கு பயன்படுகிறது.
rtrim(string, strip_characters)
Example1
<?php
$str = "cow is a domestic animal ";
echo rtrim($str);
?>
மேலே உள்ள Example1-ஐ கவனிக்கவும் $str என்ற variable-இல் "cow is a domestic animal " இந்த string-இன் இறுதியில் whitespaces உள்ளது. rtrim function-இல் இதனை arugument-ஆக அனுப்பும் போது string-ன் இறுதியில் உள்ள whitespaces remove செய்கிறது.
cow is a domestic animal
Example2
<?php
$input = "parallel codes youtube programming in tamil&&** ";
echo rtrim($input,"&&** ");
?>
மேலே உள்ள Example2-ஐ கவனிக்கவும் $input என்ற variable-இல் string-இன் இறுதியில் whitespaces மற்றும் &&** போன்ற character சேர்ந்து வந்துள்ளது. இங்கு முக்கியமாக இரண்டாவது argument-இல் ( ++--) அனுபப்படுகிறது. எனவே இங்கு whitespaces மற்றும் &&** போன்ற character-கள் remove செய்து parallel codes youtube programming in tamil என்ற string மட்டும் output-ஆக கிடைக்கிறது.
parallel codes youtube programming in tamil