Convert Array To Variables


/ Published in: PHP
Save to your folder(s)

This simply takes an array and coverts it to variables. E.g. If you had an array, $array = array("key" => "value"), after running this script, $key would be "value".


Copy this code and paste it in your HTML
  1. <?php
  2. foreach($array as $key => $value){
  3. $$key = $value;
  4. }
  5.  
  6. // simple as that

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.