Organizational Research By

Surprising Reserch Topic

php is there a safe way to extract post using -'php'


php is there a safe way to extract post  using -'php'

Is there a safe way to auto assign the keys in a posted array? Below are two examples of wrong ways...

foreach( $_POST as $key => $value ) {
     $$key = $value;
}


or

extract($_POST)


Is there a better way, or is it best to code:

$foo = $_POST('foo');
$bar = $_POST('bar');
....


for all 50 inputs on my form?

(the posted info will be inserted into a database).
    
asked Sep 7, 2015 by rajesh
0 votes
5 views



Related Hot Questions



Government Jobs Opening


...