Category Archives: TRIM

PHP trim

<?php
$text = ” Hello “;
$textlen = strlen($text);
echo “Text is : $text \n”;
echo “Text length before trim : $textlen \n”;
$text = trim($text);
$textlen = strlen($text);
echo “Text length after trim  : $textlen \n”;
?>

Result: –

Text is :  Hello

Text length before trim : 7

Text length after trim  : 5

Advertisements