<?php $array = ["test","xyz"]; $object = new stdclass(); foreach($array as $key => $value) { $object->$key = $value; } var_dump(get_object_vars($object));
You have javascript disabled. You will not be able to edit any code.