User Tools

Site Tools


documentation:php

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
documentation:php [2010/05/20 10:18] triley2documentation:php [2010/05/20 10:19] (current) triley2
Line 1: Line 1:
 +<WRAP left 40%>
 +~~TOC~~
 +</WRAP>
 +//
 +//
 +<WRAP centeralign 100% bigger>
 +<WRAP bigger fgred>Lab46 Tutorials</WRAP>
 +<WRAP muchbigger>PHP</WRAP>
 +Hyper Text Preprocessor
 +</WRAP>
 +<WRAP clear></WRAP>
 +PHP (Personal Home Page) is a scripting language used to produce dynamic web pages. It is put into html pages to give them more functionality. There is no compiling necessary, the web server interprets the code at run time.  
 +
 +===== First Web Page with PHP =====
 +<code html>
 +<html>
 +    <head>
 +        <title>My page with PHP</title>
 +    </head>
 +    <body>
 +    <?php
 +        echo "This is a hello world page!"
 +    ?>
 +    </body>
 +</html>
 +</code>
 +
 +===== Basic Commands =====
 +
 +==Variables and Comments==
 +
 +  *$ - variables (do not need to be declared)
 +  */ / - comments
 +
 +==Common Functions==  
 +
 +  * if () - decision 
 +  *else () - alternate to if
 +  *eval () - evaluate text string
 +  *Array () - creat an array
 +  *time () - outputs time 
 +  *date () - formats time output
 +  *echo () - output to page
 +  *include () - include external files
 +  *system () - call the system to execute a command
 +  *shell_exec - call the system to execute a command
 +==Regular Expressions==
 +  */ - escape character 
 +  *^ - start of string
 +  *$ - end of string
 +  *. - and single character
 +  *a? - 0 or one of a
 +  *a* - 0 or more of a
 +  *a+ - 1 or more of a
 +  *(y|z) - y or z
 +  *(...) - group selection 
 +  *[xyz] - range
 +  *[^xyz] - ont in range
 +
 +===== links =====
 +  *www.w3schools.com