<? $a[0] = 2; $a[1] = 1; $a[2] = 3; sort($a[0]); $i=0; while($i<3); echo "$a[$i]<br>"; $i++; endwhile; >
This results in:
$a[0] = 2;
$a[1] = 1;
$a[2] = 3;
sort($a[0]);
$i=0;
while($i<3);
echo "$a[$i]
";
$i++;
endwhile;
>
The include command can be used to insert other files into the current html file. This is extremely handy for headers and footers which may need to be included in hundreds of html files. By using an include command you then only need to modify the header or footer file in one place when it needs to be changed. Since full PHP parsing is done on the included file, you can also use the include command to include common PHP scripts you may have written. Sort of like having a primitive shared library of scripts you can call from your HTML file. The format of the command is: <?include "fullpath_filename">.
The crypt() command will encrypt a string using the standard Unix DES encryption method. Arguments are a string to be encrypted and an optional two-character salt string to base the encryption on. See the Unix man page for your crypt function for more information. If you do not have a crypt function on your Unix system, you can use Michael Glad's public domain UFC-Crypt package which was developed in Denmark and hence not restricted by US export laws as long as you ftp it from an non-US site.
The header command is used at the top of an html file to send raw HTTP headers. See the http specification for more information on raw http headers.
The exit command can be used to end parsing right away at this tag.
The count() function returns the number of items in an array variable. If the variable is not an array, the return value will be 1.
The system() is just like the C system() command in that it excutes the given unix command and output the result.
The exec() function also executes the given unix command, however it does not output anything. It simply returns the last line from the result of the command.