( ) are used for function parameters or for statementshardtime81 wrote:Halls whats the differenace between the two?
( {
) }
I thought it would read the script either way.
Regards,
Hardtime81
[ ] are used for vectors - arrays
{ } are used to define the begining and the end of a function;
A short example:
function your_function($param1, $param2)
{
if ($param1 > $param2) echo "Number" . $param1 . "is greater than" . $param2;
else echo "Number" . $param2 . "is greater than" . $param1;
}
$var1=1;
$var2=2;
your_function($var1, $var2);
//the print will be: Number 2 is greater than 1 <-- the else