星期三, 1月 27, 2010

MySQL 過濾 escape string

string mysql_escape_string ( string $unescaped_string )

不過要注意:
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.



官方範例:

$item "Zak's Laptop";
$escaped_item mysql_escape_string($item);
printf("Escaped string: %s\n"$escaped_item);
?>


output
Escaped string: Zak\'s Laptop

參考

沒有留言:

張貼留言