Part of the EllisLab Network
   
 
CI_Input
Posted: 21 November 2006 07:32 PM   [ Ignore ]  
Summer Student
Total Posts:  13
Joined  09-20-2006

/*
         * Convert all tabs to spaces
         *
         * This prevents strings like this: javascript
         * Note: we deal with spaces between characters later.
         *
         */        
457     $str = preg_replace("#\t+#", " ", $str);

This not work :

$str = 'window'; (word 'window must be with 'tab' ( \t )
echo $str; -> window (You see only one space, echo delete many spaces)
$str = preg_replace("#\t+#", " ", $str);
echo $str; - window


This work :

$str = str_replace("\t", "", $str);

 Signature 

PHP 5.1.6 MySQL 5.0.14a

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64453 Total Logged-in Users: 20
Total Topics: 80959 Total Anonymous Users: 1
Total Replies: 435690 Total Guests: 188
Total Posts: 516649    
Members ( View Memberlist )