PHP/String/rtrim

Материал из Web эксперт
Версия от 10:07, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Cleaning Up a String with trim(), Itrim(), and strip_tags()

   <source lang="html4strict">

<?php $text = "\t\t\tlots of room"; $text = trim( $text ); print $text; ?> == keep white space at the beginning of a string but remove it from the end. <?php $text = "\t\t\tlots of room "; $text = rtrim( $text ); print $text; ?>

 </source>
   
  


string rtrim ( string str [, string trim_chars] ) only trims whitespace from the righthand side of a string.

   <source lang="html4strict">

<?

   $string = rtrim(" testing ");

?>

 </source>