Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 544 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
544
Dung lượng
4,98 MB
Nội dung
[...]... of all the functions that the extension makes available Taking the strpos function as an example, enter the URL http://www .php. net/strpos/ (which takes you to 4 http://pecl .php. net/ 5 6 ThePHPAnthology http://www .php. net/manual/en/function.strpos .php) You’ll see the information shown in Figure 1.1 Figure 1.1 The documentation page for strpos on php. net The first line contains the name of the function,... require no installation, as they’re included with thePHP core; the documentation clearly indicates whenever this is the case with the sentence, “There is no installation needed to use these functions; they are part of thePHP core.” Nonstandard extensions are found in the PECL Repository.4 PECL, the PHP Extension Community Library, is a directory of all known PHP extensions The process for finding and... place the number of PHP developers worldwide at around 500,000 and, given the nature of the medium, it’s fair to assume that a large proportion are active online In other words, for developers of PHP- based web sites, help is only ever a few clicks away Solution There are numerous PHP resources available on the Web today, not the least of which is the official PHP Manual.3 RTFM: Read the Fine Manual There’s... Documentation Another handy way to move around the manual is to take short cuts directly to functions by submitting the name of the topic you’re interested in via the URL For example, try entering the following in your browser’s address field: http://www .php. net/strings/ This will take you to http://www .php. net/manual/en/ref.strings .php, which is the main page for the Strings extension At the bottom of the page,... accepts—and the return value, which is the value we receive after the function has run Reading from left to right, we have int, which tells us that the value returned by the function is an integer (in this case, the position of one piece of text within another) Next comes the name of the function itself, and then, in parentheses, the parameters this function takes, separated by commas Let’s look at the parameter... function, while the second line lists thePHP versions in which the function is available The third line tells us what the function actually does In this case, it’s a fairly terse explanation, but strpos really isn’t a subject that many can get excited about Under the Description heading is perhaps the most important line of all the func tion’s signature The signature describes the parameters the required... object model This has been further reinforced by the fact that on July 13, 2007thePHP development team made the end-of-life announce ment for PHP 4 The object oriented paradigm seems to scare many PHP developers, and is often regarded as being off limits to all but thePHP gurus What this book will show you is that you don’t need a computer science degree to take advantage of the object oriented features... somewhere, and their resolutions are available online This means that the most obvious (but some times forgotten) place to begin looking is Google, where a quick search for PHP strpos problem will give you an idea of what I mean 7 8 ThePHPAnthology There are also some excellent sites where you can get answers directly from other PHP developers (for free, of course—it’s part of the PHP ethic) Perhaps the three... to PHP development Two of the more popular channels are 6 7 #php on efnet.org, and # #php on freenode.net These resources can provide imme diate assistance for your problem but, like the forums, the channels’ users will expect you to have done your homework beforehand Less convenient, but perhaps the most effective last resorts are the PHP mailing lists,8 where beginners are encouraged to use the PHP. .. General User list.9 The lists 5 http://www.catb.org/~esr/faqs/smart-questions.html http://efnet.org/ 7 http://freenode.net/ 8 http://www .php. net/mailing-lists .php 9 http://news .php. net/group .php? group =php. general 6 Introduction are available for limited browsing, though it’s possible to search some of them using the Search tool on the PHP web site, and selecting the list of your choice from the search results . has been further reinforced by the fact that on July 13, 2007 the PHP development team made the end-of-life announce- ment for PHP 4. The object oriented paradigm seems to scare many PHP developers,. picture. The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition is, first and foremost, a compilation of the best solutions provided to common PHP questions that turn up at the SitePoint. . . . . . 505 THE PHP ANTHOLOGY 101 ESSENTIAL TIPS, TRICKS & HACKS BY DAVEY SHAFIK MATTHEW WEIER O’PHINNEY LIGAYA TURMELLE HARRY FUECKS BEN BALBO 2ND EDITION iv The PHP Anthology: 101 Essential