3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datetoday = date('dmy'); $row_Num = '1'; $i = 0; $count = 0; // I added this line to take care of how many times the loop runs foreach ($_REQUEST as $key => $value) { (strstr($key, 'date')) ? $count++ : NULL; } // Changed '<=' to '<' since it would loop 3 times since we start $i at 0 while ($i < $count) { ${'date_' . $i} = $_REQUEST["date_$i"]; ${'text_' . $i} = $_REQUEST["text_$i"]; ${'con_name_' . $i} = $_REQUEST["con_name_$i"]; ${'con_phone_' . $i} = $_REQUEST["con_phone_$i"]; $values = array( ${"date_" . $i}, ${"text_" . $i}, ${"con_name_" . $i}, ${"con_phone_" . $i} ); echo '<pre>', print_r($values, true), '</pre>'; $sql = "INSERT INTO `data`.`".$datetoday."` (`KEY`,`DATE`,`COLOR`,`TEXT`,`CON_NAME`,`PHONE`) VALUES ( '".$i."', '".$values[0]."', 'FFFFFF', '".$values[1]."', '".$values[2]."', '".$values[3]."' )"; echo '<pre>', $sql, '</pre>'; //$result = mysql_query($sql, $link) or die ('Could not insert values: '.mysql_error()); $i++; }
Output for git.master, git.master_jit, rfc.property-hooks

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:
53.31 ms | 401 KiB | 8 Q