Jump to content

[SOLVED] Parse error: syntax error, unexpected T_STRING


tommyda

Recommended Posts

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  ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.