PHP is a programming language and programming environment for to develop of web application, scripts and much more!!!
PHP is supported by php community and the Zend company.
PHP meaning "PHP: Hypertext Preprocessor" and was written by Ramus Lerdorf in 1994 and was improve by Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion - Israel Institute of Technology in 1997.
The syntax of the PHP language is very simple and is very seemed to C or PERL language.
Is possible to embedded PHP instructions in any type of file for to be processed by the PHP compiler. The PHP compiler search all PHP instructions into of the file that begin with the PHP opening tag and executed the instructions even that find the PHP closing tag.
Exist four types of PHP opening and closing tags:
1.- In the standard way:
<?php
echo 'if you want to serve XHTML or XML documents, do like this';
?>
2.- As processing instruction:
<script language="php">
echo 'some editors (like frontpage) don't like processing instructions';
</script>
3.- Short tags:
<? echo 'this is the simplest, an SGML processing instruction'; ?>
<?= "hi world" ?> this is a shortcut
4.- ASP style tags:
<% echo 'You may optionally use ASP-style tags'; %>
<%= "hellow world!"; %>
For to use short tags and ASP tags will be need that you enabled the next directive in the configuration file "php.ini": short_open_tag and asp_tags.
short_open_tag = on
asp_tags = on
In PHP also as in C or Perl, PHP requires instrutions to be terminated with a semicolon at the end of each statement.
Surrounding at the newline characters is important to know that all character out of the php tags is out putting and will not be processed by the php compiler but they possibly will affect the http headers generating an error.
Conclusion
Today we learned the basic syntax of a php script.
Lab Practices.
In developing...

No hay comentarios:
Publicar un comentario