foreach is a simple loop mostly used to read an array line by line;
$arr = array("one", "two" , "three");
foreach($arr as $c) {
echo $c;
}
it'll output : onetwothree
also try looking up the while loop
while, do...while, for, foreach are used
Below is a simple example of how you could return a value in a PHP function. <?php function returnme($value) { return $value; } echo returnme('hello'); // outputs: hello ?>
A simple function call <html> <body> <?php if(isset($_POST['button'])) { setValue(); // Function is called } function setValue() { echo "<br>The button property to call PHP function works"; // Your code here } ?> <input type="submit" name="button" onclick=<?php $_SERVER['PHP_SELF']; ?> /> </body> </head>
chdir() PHP function helps in changing the current directory.
It gets options from the command line argument list. It can be used in PHP 4.3 and above, including PHP 5.
The foreach construct simply gives an easy way to iterate over arrays. Foreach works only on arrays (and objects).
while, do...while, for, foreach are used
The PHP foreach construct is used to iterate over arrays. This is done in the field of mathematics. It will issue errors when one tries to use it as a variable instead of arrays and objects.
build an array of vowels then do a foreach on the array and then explode the string on the array value and the answer is -1 of the result
There is no 'foreach' in C
PHP mail has a variety of functions. The main function is to reroute mail from one server to another. The benefit of doing this is so one doesn't overload the current server.
in php used for one typ website
we cant use set timeout function in php because it is of java script function
Below is a simple example of how you could return a value in a PHP function. <?php function returnme($value) { return $value; } echo returnme('hello'); // outputs: hello ?>
function function_name() { .................... }
The eval() function evaluates a string as PHP code. http://us.php.net/manual/en/function.eval.php
A simple function call <html> <body> <?php if(isset($_POST['button'])) { setValue(); // Function is called } function setValue() { echo "<br>The button property to call PHP function works"; // Your code here } ?> <input type="submit" name="button" onclick=<?php $_SERVER['PHP_SELF']; ?> /> </body> </head>