3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 0 => "(Type): multiplechoice", 1 => "(Question): Which of the following is true about pre-test imagery?", 2 => "(A): People with a cranial fault can visualize the muscle being strong and make it go strong, while people without a cranial faults cannot.", 3 => "(B): If Governing Vessel (GV) 20 tests weak, it also means they have a cranial fault. This is on the midline at the apex of the head.", 4 => "(C): The three most common cranial faults are TMJ, occiput and sphenoid", 5 => "(D): All of the above", 6 => "(Correct): D", 7 => "(Type): multiplechoice", 8 => "(Question): Which of the following is not true about the TMJ?", 9 => "(A): Every single TMJ nerve pathway goes through the mesencephalon in the midbrain.", 10 => "(B): When you work on the TMJ it is a neurological back-up for the entire body.", 11 => "(C): To correct press on the glabella with one hand as you press of the back of the head with the other as the patient touches the chin with two fingers and breathes in only one time.", 12 => "(Correct): C", 13 => "(Type): truefalse", 14 => "(Question): To test for a deficiency of the four primary neurotransmitters, point the edge of a magnet straight in at each of the four corresponding cranial bon ▶", 15 => "(A): True", 16 => "(B): False", 17 => "(Correct): A"); //Var_dump($arr); $j=-1; $res = array(); Foreach($arr as $value){ If(preg_match("/\(Type\)/", $value, $match)){ $j++; } preg_match("/\((.*?)\): (.*)/", $value, $match); $res[$j][$match[1]]= $match[2]; } Var_dump($res);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> array(7) { ["Type"]=> string(14) "multiplechoice" ["Question"]=> string(54) "Which of the following is true about pre-test imagery?" ["A"]=> string(134) "People with a cranial fault can visualize the muscle being strong and make it go strong, while people without a cranial faults cannot." ["B"]=> string(128) "If Governing Vessel (GV) 20 tests weak, it also means they have a cranial fault. This is on the midline at the apex of the head." ["C"]=> string(66) "The three most common cranial faults are TMJ, occiput and sphenoid" ["D"]=> string(16) "All of the above" ["Correct"]=> string(1) "D" } [1]=> array(6) { ["Type"]=> string(14) "multiplechoice" ["Question"]=> string(49) "Which of the following is not true about the TMJ?" ["A"]=> string(78) "Every single TMJ nerve pathway goes through the mesencephalon in the midbrain." ["B"]=> string(74) "When you work on the TMJ it is a neurological back-up for the entire body." ["C"]=> string(178) "To correct press on the glabella with one hand as you press of the back of the head with the other as the patient touches the chin with two fingers and breathes in only one time." ["Correct"]=> string(1) "C" } [2]=> array(5) { ["Type"]=> string(9) "truefalse" ["Question"]=> string(152) "To test for a deficiency of the four primary neurotransmitters, point the edge of a magnet straight in at each of the four corresponding cranial bon ▶" ["A"]=> string(4) "True" ["B"]=> string(5) "False" ["Correct"]=> string(1) "A" } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
69.88 ms | 405 KiB | 8 Q