PHP: The Good Parts

PHP: The Good Parts

Peter MacIntyre

Language: English

Pages: 178

ISBN: 0596804377

Format: PDF / Kindle (mobi) / ePub


Get past all the hype about Php and dig into the real power of this language. This book explores the most useful features of Php and how they can speed up the web development process, and explains why the most commonly used Php elements are often misused or misapplied. You'll learn which parts add strength to object-oriented programming, and how to use certain features to integrate your application with databases.

Written by a longtime member of the Php community, Php: The Good Parts is ideal for new Php programmers, as well as web developers switching from other languages.

  • Become familiar with Php's basic syntax, variables, and datatypes
  • Learn how to integrate the language with web pages
  • Understand how to use strings, arrays, and Php's built-in functions
  • Discover the advantages of using Php as an object-oriented language
  • Explore how Php interacts with databases, such as Sqlite and MySql
  • Learn input- and output-handling best practices to prevent security breaches

Sustainable Infrastructure: The Guide to Green Engineering and Design

The Business of Android Apps Development: Making and Marketing Apps that Succeed on Google Play, Amazon Appstore and More

Exploring C++: The Programmer’s Introduction to C++

jQuery Mobile: Up and Running

 

 

 

 

 

 

 

 

 

 

 

 

 

that you can access information that is established on one page and use it in a called file. It’s important to understand that the $_GET array is refreshed on each page call, so you have to pass it on to each page being called further down the call stack. It’s different than the session concept in this regard. $_POST The $_POST superglobal array is almost identical to the $_GET array in that it can pass values effectively from one page to the next; the difference lies in the method of passing

add the MySQL library to the PHP environment before it will work at all. 32 | Chapter 3: Functions (Doing It Once) CHAPTER 4 Strings The string is one of the most widely used forms of web output. A string is simply a collection of text—letters, numbers, special characters, or a combination thereof. Strings can be manipulated, cut, trimmed, truncated, spliced, and concatenated with ease in PHP. We have already seen some examples of strings being sent out to the web browser in Chapters 1 and

String Functions (Best of) | 39 strstr: bool(false) stristr: string(33) “brown fox jumps over the lazy dog” strstr: string(12) “the lazy dog” stristr: string(43) “The quick brown fox jumps over the lazy dog” The first attempt returns false since the capitalized word “BROWN” is not in the provided string. But when we search for it irrespective of case by using stristr, we get the expected result. In the second grouping, we change the needle to “the” and the resulting output is also as expected:

has sorted keys). The following is some sample code that shows all these sorting functions in action. I am a huge fan of the rock band Genesis, so the following code examples are my tribute to the fact that they have finally been inducted into the Rock and Roll Hall of Fame! $ClassicGenesis = array("Tony Banks", "Phil Collins","Mike Rutherford", "Steve Hackett","Peter Gabriel" ) ; sort ($ClassicGenesis) ; echo "Sorted on Values with re-generated Keys:
"; foreach

6 in this book or are familiar with object-oriented programming before going too far into the examples. These three libraries were chosen because they are helpful for performing some of the top tasks in a modern web-based application: sending email messages or Short Message Service (SMS) text messages, generating PDF forms, and generating graphical data reports (e.g., pie charts and bar charts). Email/SMS Generation PHP has a built-in mail function called mail(). This will send out Simple Mail

Download sample

Download