Home > Backend Development > PHP Tutorial > A saddslashes function that supports arrays

A saddslashes function that supports arrays

WBOY
Release: 2016-07-25 09:02:55
Original
853 people have browsed it
  1. //SQL ADDSLASHES
  2. function saddslashes($string) {
  3. if(is_array($string)) {
  4. foreach($string as $key => $val) {
  5. $string[$key] = saddslashes($val);
  6. }
  7. } else {
  8. $string = addslashes($string);
  9. }
  10. return $string;
  11. }
  12. ?>
复制代码


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template