Download e-book for kindle: Advanced PHP Programming : A Practical Guide to Developing by George Schlossnagle

By George Schlossnagle

ISBN-10: 0672325616

ISBN-13: 9780672325618

Over the last 3 years Hypertext Preprocessor has advanced from being a distinct segment language used so as to add dynamic performance to small websites to a strong instrument making robust inroads into large-scale, business-critical net platforms.   The fast maturation of personal home page has created a skeptical inhabitants of clients from extra conventional "enterprise" languages who query the readiness and skill of Hypertext Preprocessor to scale, in addition to a wide inhabitants of personal home page builders with no formal desktop technology backgrounds who've realized during the hands-on experimentation whereas constructing small and midsize functions in Hypertext Preprocessor.   whereas there are various books on studying personal home page and constructing small purposes with it, there's a critical lack of expertise on "scaling" personal home page for large-scale, business-critical structures. Schlossnagle's complicated Hypertext Preprocessor Programming fills that void, demonstrating that Hypertext Preprocessor is prepared for firm net functions by means of exhibiting the reader how one can increase PHP-based purposes for max functionality, balance, and extensibility.

Show description

Read or Download Advanced PHP Programming : A Practical Guide to Developing Large-scale Web Sites and Applications With PHP 5 PDF

Similar programming: programming languages books

Read e-book online Professionell entwickeln mit Visual C# 2010 PDF

Эта энциклопедия будет интересна в первую очередь современным охотникам, любителям стрельбы по тарелочкам и коллекционерам. Написанная специалистом по оружию, она может служить справочным пособием для всех любителей охотничьего оружия.

Extra info for Advanced PHP Programming : A Practical Guide to Developing Large-scale Web Sites and Applications With PHP 5

Example text

Php echo “Hello $username”; ? You should take advantage of this ability. >

The second code fragment is cleaner and does not obfuscate the HTML by unnecessarily using echo. >, requires the use of short_tags, which there are good reasons to avoid. print Versus echo print and echo are aliases for each other; that is, internal to the engine, they are indistinguishable. You should pick one and use it consistently to make your code easier to read. You can write this: if($month == ‘february’) { if($year % 4 == 0 && $year % 100 || $year % 400 == 0) { $days_in_month = 29; } else { $days_in_month = 28; } } However, this forces the reader to remember the order of operator precedence in order to follow how the expression is computed.

For example, if you wanted to add an extra line to this example, where $name is set, and weren’t paying close attention, you might write it like this: if(isset($name)) echo “Hello $name”; $known_user = true; This code would not at all do what you intended. Therefore, to avoid confusion, you should always use braces, even when only a single statement is being conditionally executed: if(isset($name)) { echo “Hello $name”; } else { echo “Hello Stranger”; } Consistently Using Braces You need to choose a consistent method for placing braces on the ends of conditionals.

Here’s an example: function hello($name) { print “Hello $name\n”; } In this case, hello is inserted into another symbol table, this one for functions, and tied to the compiled optree for its code. Chapter 20, “PHP and Zend Engine Internals,” explores how the mechanics of these operations occur in PHP, but for now let’s focus on making code readable and maintainable. Variable names and function names populate PHP code. Like good layout, naming schemes serve the purpose of reinforcing code logic for the reader.

Download PDF sample

Advanced PHP Programming : A Practical Guide to Developing Large-scale Web Sites and Applications With PHP 5 by George Schlossnagle

by Daniel

Rated 4.10 of 5 – based on 14 votes