for loop in php
/*
For loop in php
*/
<?php
for ($i = 0; $i < 10; $i++) {
echo $i."<br>";
}
?>
for loop in php
/*
For loop in php
*/
<?php
for ($i = 0; $i < 10; $i++) {
echo $i."<br>";
}
?>
math.pow in C# using loop
static float CalculatePower(float x, int y)
{
float temp;
if (y == 0)
return 1;
temp = CalculatePower(x, y / 2);
if (y % 2 == 0)
return temp * temp;
else
{
if (y > 0)
return x * temp * temp;
else
return (temp * temp) / x;
}
}
foreach loop not working in php
<?php
$songs = $_POST["songs"];
//$songs = Array("one","two","three");
foreach ($songs as $song)
{
$songStr = test_input($song);
$songsOut .= "<li>$songStr</li>";
};
$songList = "Songs: <ol> $songsOut </ol> \r\n";
echo $songList;
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us