PHP overview:
php is the abbreviation of Hypertext Preprocessor (Hypertext Preprocessor). It is a server-side, cross-platform, HTML-embedded scripting language. Its unique syntax mixes C language, Java language and Perl language. It is a widely used open source multi-purpose scripting language,
especially suitable for web development. PHP is a b/s architecture and a three-tier structure. After the service is started, users do not need corresponding client software and can only use a browser to browse. This not only saves the graphical user interface, but also greatly reduces the amount of application maintenance. PHP originated from free software, that is, open source software.
Using PHP for web application development has high security, cross-platform features, supports a wide range of databases, is easy to learn, has fast execution speed, low cost, templates, and supports Object-oriented, built-in Zend acceleration engine, stable and fast performance and other advantages. Ranked third in the Tiobe world programming rankings, with a market share of 9.977%.
PHP extension library:
Starting from php5, there are new built-in standard extension libraries: XML extension library-DOM, SimpleXML, SPL, SQLite, and libraries like MySql, MySqlI, Overload, GD2, etc. In the PECL external extension library, load it first in the php.ini configuration file when needed. The default location of the php search extension library
in PHP5 is C:php5. To modify this to match the user's own PHP settings, you need to edit the php.ini file: you need to modify the extension_dir setting to point to the directory where the user places the extension library or the location where the php_*.dll files are placed. For example: extension_dir=C
:phpextensions; To enable an extension library in php.ini, you need to remove the comment symbol prefixed by extension=php_*.dll in the line, and replace the semicolon (; ) can be deleted, for example, to enable the Bzip2 extension library. Change the following code; extension=php_bz2.dll
to extension=php_bz2.dll;
Preparatory work:
1. HTML (Hypertext Markup Language, Hypertext Markup Language) cornerstone of web development
2 .Javascript, a client-side scripting language, can also write scripts that are executed on the server side.
Basic process of website construction:
Determine the website theme (main content: comprehensive and in-depth)-->Collect materials-->Plan the website (structure, layout, color matching, style, etc.)-->Select Development tools --> Make web pages (large first, then small [structure], simple first, then complex) --> Test website --> Upload website --> Promotion --> Maintenance
Maintenance and update -->Determine the website theme.
php learning resources:
Development tool download website: http://www.jb51.net
php user manual official website: http://www.php.net
Commonly used website resources:
phpchina open source community: http://www.phpchina.com
How to learn PHP well:
1. Clarify your learning goals and general direction.
2. Learn to configure the PHP development environment
3. Have a solid basic understanding of programming knowledge and master commonly used functions.
4. Understand design patterns.
5. Practice more, think more, and ask for more advice.
6. The most taboo thing about learning technology is impatience. When encountering technical problems, you must treat them calmly.
7. There are thousands of php functions, download a php Chinese manual and a MySql manual.
8. Watch more videos and understand other people’s programming ideas.
9. Develop good programming habits.
10. Don’t give up when you encounter problems, but have the spirit of perseverance and perseverance.
The php configuration is a bit complicated. I spent a long time configuring it last night but it still didn’t work! I had to find a simpler solution: WampServer 5 integrated environment
Wamp5 is Apache+PHP+Mysql under Windows An integrated environment with simple graphics and
menu installation. This version integrates PHP5.2.5 Mysql5 Apache2 phpMyAdmin 2.11.2.1
SQLiteManager 1.2.0, which meets the needs of most PHPers.
Grammatically, the PHP language is similar to the C language. It can be said that PHP draws on the grammatical features of the C language and is modified from the C language. We can mix PHP code and HTML code. Not only can we embed PHP scripts in HTML
files, we can even embed HTML tags in PHP scripts. Here are a few approaches you can take.
You can choose the one that suits you best and stick to it!
Separate from HTML
Here are the methods that can be used:
. . . ?>
<% . . . %>
Like Perl and C, in In PHP, ";" is used to separate statements. Those separate tags from HTML also indicate the end of a statement.
Comments
PHP supports C, C and Unix style comments:
/* C, C style multi-line comments*/
// C style single line comments
# Unix-style single-line comments
How to handle simple PHP errors:
1. You must set display_errors = On in PHP.ini to display the error location
2 , get used to using echo or print to print
3. Learn to use comments to mask symbols for debugging
// ……….
/*………… */
#... ...........
4. Know how to read error messages (if you are not familiar with English, you should know Arabic numerals)