tommyda Posted January 25, 2009 Share Posted January 25, 2009 The error : Parse error: syntax error, unexpected T_STRING in /home/biorust/public_html/sanitize.php on line 7 Sanitize.php <?php class filter { // Removes all whitespace from a string, including whitespace that isn't trailing or leading public function whitespace($str){ retrun preg_replace('/\s\s+/',' ', $str); } // Removes characters not valid in an e-mail address public function email($email){ return strtolower(preg_replace('/[^a-z0-9+_.@-]/i','',$email)); } // Removes tags, whitespace public function text($str){ // Ensure it's a string $str = strval($str); // We strip all html tags $str = strip_tags($str); // Remove any whitespace using // the define method above $str = $this->whitespace($str); return $str; } } ?> Can anyone please remove the barrier and help me get one step closer to becoming a php master Link to comment https://forums.phpfreaks.com/topic/142387-solved-parse-error-syntax-error-unexpected-t_string/ Share on other sites More sharing options...
Mchl Posted January 25, 2009 Share Posted January 25, 2009 retrun is not return You've got simple spelling mistake in line 7 Link to comment https://forums.phpfreaks.com/topic/142387-solved-parse-error-syntax-error-unexpected-t_string/#findComment-746028 Share on other sites More sharing options...
Mchl Posted January 25, 2009 Share Posted January 25, 2009 I'm replying to this topic, because it got stuck in my 'unread messages' list Link to comment https://forums.phpfreaks.com/topic/142387-solved-parse-error-syntax-error-unexpected-t_string/#findComment-746036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.