niche Posted September 23, 2010 Share Posted September 23, 2010 How do I get array flip to return results other than "Array" after user input?Script: <?phpsession_start();?><form method="post" action="">First Name:<input type="text" name="Fname">:<br />Middle Name:<input type="text" name="Mname">:<br />Last Name:<input type="text" name="Lname">:<br /><input type="submit" value="submit" name="submit"><br /></form><br /> </form><?phpecho var_dump($_POST) .'<br/>';echo array_flip($_POST); ?> Link to comment Share on other sites More sharing options...
justsomeguy Posted September 23, 2010 Share Posted September 23, 2010 When you echo an array it prints the word "array". That's all that's going on, you're just echoing the return value from array_flip, which is an array. Link to comment Share on other sites More sharing options...
niche Posted September 23, 2010 Author Share Posted September 23, 2010 Silly me.New script: echo var_dump($_POST) .'<br/>';$a = array_flip($_POST);echo var_dump($a) .'<br/>'; Thank-you justsomeguy. Link to comment Share on other sites More sharing options...
jeffman Posted September 24, 2010 Share Posted September 24, 2010 Is this just an experiment? I can't imagine flipping a $_POST array . . . Link to comment Share on other sites More sharing options...
niche Posted September 24, 2010 Author Share Posted September 24, 2010 Just an experiment. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.