function Test() { static $a = 1; echo "{$a} "; $a++; if ($a < 10) { Test(); } }
function Test() { static $count = 0; $count++; echo $count; if ($count < 10) { Test(); } $count--; }
//execute post $result = curl_exec($ch); $json = json_decode($result, true); if ($json["success"] != "true") { $err .= "Jūs kļūdījāties ar reCaptcha ievadu!\n"; } // $passwords = array("parole" => $ar["parole"], "parole_test" => $ar["parole-test"]); $err .= CheckLogin($ar["niks"], "text"); $err .= Test($passwords, "password"); // if ($ar["parole"] != $ar["parole-test"]) // $err .= "Paroles nesakrīt. Pārbaudiet savu paroli!"; $err .= Test($ar["vards"], "text") . "\n"; $err .= Test($ar["uzvards"], "text") . "\n"; $err .= Test($ar["epasts"], "email") . "\n"; $err .= Test($ar["talrunis"], "tel") . "\n"; if (strlen($err) > 0) { exit($err . "\nPārbaudiet, vai visi lauki ir pareizi aizpildīti!\n"); } else { $link = DBConnect::GetConnection(); $stmt = mysqli_prepare($link, "INSERT INTO users (login, password, vards, uzvards, epasts, talrunis) VALUES (?, ?, ?, ?, ?, ?)"); mysqli_stmt_bind_param($stmt, 'sssssi', $ar["niks"], md5($ar["parole"]), $ar["vards"], $ar["uzvards"], $ar["epasts"], $ar["talrunis"]); if (mysqli_stmt_execute($stmt)) { echo "success"; } else { echo "Notika kāda kļūda, kamēr centijamies izveidot lietotāju. Shit happens when you try to update DB on free hosting, try again!"; } mysqli_stmt_close($stmt); mysqli_close($link); exit; }
<?php $a = 1; function Test($a) { if ($a < 3) { return 3; } } if ($a < Test($a)) { echo "{$a}\n"; $a++; }
public function onWorkerStart($serv, $worker_id) { require_once "reload_page.php"; Test(); }
$this->size--; } } } function Test() { $t = new HashTable(); $text = "YEAR OF GLAD. I am seated in an office, surrounded by heads and bodies. My posture is consciously congruent to the shape of my hard chair. This is a cold room in University Administration, wood-walled, Remington-hung, double-windowed against the November heat, insulated from Administrative sounds by the reception area outside, at which Uncle Charles, Mr. deLint and I were lately received."; $arr = explode(" ", $text); foreach ($arr as $item) { $item = (string) $item; } for ($i = 0; $i < sizeof($arr); $i++) { $t->set($arr[$i], $i); } $res = array(); foreach ($arr as $item) { array_push($res, $t->get($item)); } print_r($res); for ($i = 0; $i < 10; $i++) { $t->remove($arr[$i]); } foreach ($arr as $item) { array_push($res, $t->get($item)); } print_r($res); } Test(); // $slot = array_fill(0, 50, new Entry(1,1)); // print_r($slot);
sql_query("UPDATE " . $NPDS_Prefix . "lnl_body SET text='{$xtext}' WHERE ref='{$ref}'"); header("location: admin.php?op=lnl_Shw_Body&Bodyid={$ref}"); break; case "Add_Footer": Add_Header_Footer("FOT"); break; case "Add_Footer_Submit": Add_Header_Footer_Submit("FOT", $xtext, $html); header("location: admin.php?op=lnl"); break; case "Add_Footer_Mod": sql_query("UPDATE " . $NPDS_Prefix . "lnl_head_foot SET text='{$xtext}' WHERE ref='{$ref}'"); header("location: admin.php?op=lnl_Shw_Footer&Footerid={$ref}"); break; case "Test": Test($Xheader, $Xbody, $Xfooter); break; case "List": lnl_list(); break; case "User_List": lnl_user_list(); break; case "Sup_User": sql_query("DELETE FROM " . $NPDS_Prefix . "lnl_outside_users WHERE email='{$lnl_user_email}'"); header("location: admin.php?op=lnl_User_List"); break; case "Send": $deb = 0; $limit = 50; // nombre de messages envoyé par boucle.
$privilege_root_path = "/admin"; require_once "includes/include_all_fns.inc"; require_once "{$php_root_path}/includes/page_includes/page_fns.php"; session_start(); $err_message = " Unable to process your request due to the following problems: <br>\n"; do_html_header("Admin Bulk Accept Papers", &$err_message); //Establish database connection $db = adodb_connect(); if (!$db) { echo "Could not connect to database server - please try later."; exit; } if ($_POST["test"] === "Test") { $min = floatval($_POST["min"]); $max = floatval($_POST["max"]); Test($db, $min, $max); } else { if ($_POST["submit"] === "Accept/Reject these papers") { $min = floatval($_POST["min"]); $max = floatval($_POST["max"]); Process($db, $min, $max); echo '<p style="color:lime;font-weight:bold;">Bulk Accept/Reject done.</p>'; } else { $min = 10; $max = 0; } } //Get the total number of submitted papers $countPapersSQL = "SELECT COUNT(*) AS totalPapers FROM " . $GLOBALS["DB_PREFIX"] . "Paper WHERE Withdraw = 'false'"; $countPapersResult = $db->Execute($countPapersSQL); $countPapersInfo = $countPapersResult->FetchNextObj();
<?php function Test(array $only = null) { $only = !is_null($only) ? $only : []; return $only; } echo "<pre>"; print_r(Test()); print_r(Test([1, 2, 3, 4])); echo "</pre>";