note 102825 added to function.mysql-real-escape-string

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
// Simplify, and don't forget to check the key names.

function from_array($x=null) {
  if(!isset($x)) return null;
  else if(is_string($x)) return mysql_real_escape_string($x);
  else if(is_array($x)) {
    foreach($x as $k=>$v) {
      $k2=mysql_real_escape_string($k);
      if($k!=$k2) unset($x[$k]);
      $x[$k2]=from_array($v);
    }
    return $x;
  }
}

// call it with $x=from_array($_POST['key_name']);
// or even $_POST=from_array($_POST);
----
Server IP: 69.147.83.197
Probable Submitter: 24.84.35.78
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit        -- https://master.php.net/note/edit/102825
Del: integrated  -- https://master.php.net/note/delete/102825/integrated
Del: useless     -- https://master.php.net/note/delete/102825/useless
Del: bad code    -- https://master.php.net/note/delete/102825/bad+code
Del: spam        -- https://master.php.net/note/delete/102825/spam
Del: non-english -- https://master.php.net/note/delete/102825/non-english
Del: in docs     -- https://master.php.net/note/delete/102825/in+docs
Del: other reasons-- https://master.php.net/note/delete/102825
Reject      -- https://master.php.net/note/reject/102825
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.