<?php $tx = ["ans1","ans2","ans3"]; for ($i=0, $max=3; $i < $max; $i++) { $o[] = new stdClass; $o[$i]->text = $tx[$i]; } print_r( $o );
You have javascript disabled. You will not be able to edit any code.