Experienced programmers may have less need for external learning and can use PHP as any other server-side programming language to generate HTML for browsers and use it for other purposes. Most of these programmers prefer simple text editing. Usually such software will provide you with some useful tools, such as syntax color emphasis, bracket matching, or automatic tag closing. Most of these functions are just to help you unintentionally, but they will not really help. You write programs.
The most exciting tool for working with PHP has emerged. It's called Zend Studio, which at the time of writing is in its second edition. This product combines a powerful debugging tool (although it is still not a WYSIWYG tool) Editing environment, this smart product can help you significantly save time checking for correct PHP function syntax duplication, allowing you to quickly eliminate errors. Since development time is money, the small cost of this product will make you more Productivity, you can really find that the symbols of this IDE know the syntax of PHP. Zend Studio is the first development tool that is not just redesigned to achieve some purposes. Figure 3-1 is an illustration of the Zend Studio user interface.
As you can see in Figure 3-1, Zend Studio allows you to execute PHP programs and preview the HTML output in the window. You do not need to use a browser to view the original view source code, and this The method is not a standard result or a luxurious display, but the debugging tool can provide you with powerful assistance. You can check the program code line by line or jump into or out of function inspection, set break points, and stack trace processing. , track all the global and private variables of the file or check the contents of a specific number. In this easy-to-use GUI interface, you will be reminded of the potential dangers of using undeclared variables. Syntax color highlighting and program indentation can be It is easy and free to adjust, new users can avoid the inconvenience of using emacs or vi, and the automatic completion of the program can save you from repeatedly consulting PHP online instructions (such as whether it is strreplace or str_replace, and what is the order of parameters, etc. ), you can also use the program's auto-complete function when using your HTML, especially when you must memorize the attributes allowed by each tag. You can even register your own defined functions or auto-complete lists to make it more It is easy to use without having to refer to the function definition again and again, which is very convenient if you are used to passing a series of parameters to the function. As you work with larger, more complex, and function-intensive libraries, you'll find that this IDE can help you more.
Remember that your development server does not have to use the same operating system as the server you serve, this is the greatest value of cross-platform development, especially if you use a Unix server (even for The Blues Brothers), we all have two Various document editors: emacs and vi, and even Macintosh and Windows have more user-friendly document tools. Unix, on the other hand, makes it easy for you to support client operating systems on multiple machines. Many developers have designed certain features of these tools to their best advantage. Emacs, vi and Zend Studio are all editors that can run on many major platforms, so if your development team uses the above standard tools, people can Use these tools with many operating system preferences.
Table 3-2 shows some of the editors from major operating systems used by most programmers.
If you are developing between multiple operating systems, remember that line breaks and some characters are incompatible between Windows and Unix. Line breaks in Unix format will display a black color symbol on Notepad, while Windows The line break format looks like the ∧M character in Unix editors. Your PHP program may still function normally, but you may go crazy when using files edited on different platforms. There are many reasons for this, and there are good ideas to solve it. The best solution to this type of line breaking problem is to use a version control system such as CVS.
In addition to these well-known choices, Keith Edmunds maintains a detailed list of text editors suitable for PHP, many of which are free or require only a small fee.
http://phpeditors.dancinghippo.com/
Take a deep breath. After all the installation and settings, you should now be able to write your first PHP program.
Table 3-2 Common PHP editors on different platforms
Summary
Before we can use PHP, we need to decide whether to host it ourselves, outsource it, or adopt a compromise solution such as hosting. Among the most important factors in this decision-making process are the cost of the site, its size and traffic, special hardware or software requirements, the type of content and expectations for control. External web hosting services are the best choice for small websites with no special needs.
If you decide to build or maintain your own development server, detailed installation guidelines and instructions for most common platforms are provided earlier in this chapter. Although PHP4 supports many different types of web servers, at the time of writing this book there is no official documentation describing the details of their installation.
Finally, readers may wonder which development tools are best for PHP. Before there was an integrated development environment (IDE) specifically for PHP, most PHP developers used their favorite text editor to write programs. It is possible to add PHP functionality to a so-called WYSIWYG editor, but it will look messy.
The above is the content of PHP Learning Guide - Chapter 3 (continuation). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!