Convert Array to Object

<?php

$array_to_convert = $_GET;
print_r(convert_to_object($array_to_convert));

function convert_to_object($array_to_convert){
$myObject = (object) $array_to_convert;
return $myObject;
}
?>

0 Comments

You must be logged in to post a comment.