PHP in a Nutshell: A Desktop Quick Reference

PHP in a Nutshell: A Desktop Quick Reference

Paul Hudson

Language: English

Pages: 372

ISBN: 0596100671

Format: PDF / Kindle (mobi) / ePub


Now installed on more than 20 million Internet domains around the world, PHP is an undisputed leader in web programming languages. Database connectivity, powerful extensions, and rich object-orientation are all reasons for its popularity, but nearly everyone would agree that, above all, PHP is one of the easiest languages to learn and use for developing dynamic web applications. The ease of development and simplicity of PHP, combined with a large community and expansive repository of open source PHP libraries, make it a favorite of web designers and developers worldwide.

PHP in a Nutshell is a complete reference to the core of the language as well as the most popular PHP extensions. This book doesn't try to compete with or replace the widely available online documentation. Instead, it is designed to provide depth and breadth that can't be found elsewhere. PHP in a Nutshell provides the maximum information density on PHP, without all the fluff and extras that get in the way. The topic grouping, tips, and examples in this book complement the online guide and make this an essential reference for every PHP programmer. This book focuses on the functions commonly used by a majority of developers, so you can look up the information you need quickly. Topics include:

  • Object-oriented PHP
  • Networking
  • String manipulation
  • Working with files
  • Database interaction
  • XML
  • Multimedia creation
  • Mathematics

Whether you're just getting started or have years of experience in PHP development, PHP in a Nutshell is a valuable addition to your desk library.

Getting Started with Mule Cloud Connect: Accelerating Integration with SaaS, Social Media, and Open APIs

Linux Kernel in a Nutshell

Slicing Pie: Funding Your Company Without Funds (Version 2.3)

PHP for the Web: Visual QuickStart Guide (4th Edition)

 

 

 

 

 

 

 

 

 

 

array(3) { [0]=> array(4) { ["file"]=> string(20) "C:\php\backtrace.php" ["line"]=> int(6) ["function"]=> string(1) "C" ["args"]=> array(2) { [0]=> &string(3) "baz" [1]=> &string(3) "wom" } } [1]=> array(4) { ["file"]=> string(20) "C:\php\backtrace.php" ["line"]=> int(3) ["function"]=> string(1) "B" ["args"]=> array(2) { [0]=> &string(3) "bar" [1]=> &string(3) "baz" } } [2]=> array(4) { ["file"]=> string(20) "C:\php\backtrace.php" ["line"]=> int(11) ["function"]=> string(1) "A" ["args"]=>

function returns true if its parameter has already been set in your script. This is not the same as the empty(): if a variable was set and had no value, isset() would return true, and empty() would return false. To check for "variable not set," use the not operator !, as in if (!isset($foo)). Name ltrim() Synopsis string ltrim ( string str [, string trim_chars] ) The ltrim() function works like the normal trim(), except it only trims whitespace from the lefthand side of a string.

permissions. Here is an example script: $testfile = @readfile("/home/paul/test.txt"); // OR "@readfile("c:\\boot.ini");" if you are using Windows if (!$testfile) { print "Could not open file.\n"; } If readfile() fails to open the file, it will print an error message to the screen. You can suppress this by placing an @ symbol before the function call. The advantages to using readfile() are clear: there is no fuss, and there is little way for it to go wrong. However, the disadvantage is equally

function, which takes the SQL query you want to perform as its parameter. It will then perform that query and return a special resource known as a MySQL result index, which contains a pointer to all the rows that matched your query. "Result index" is nothing more than a fancy term for a MySQL resource type, but you will see it used in MySQL error messages. This result index is the return value of mysql_query(), and you should save it in a variable for later use. Whenever you want to extract rows

database library —enable-soap Enables support for SOAP protocol library —enable-sockets Enables support for Internet sockets —with-tidy Enables support for the Tidy HTML/XML library —with-zlib Enables support for zlib; needed for some graphics formats For more information on these and other options, use ./configure —help to see the full list. Testing Your Configuration To test your configuration, create the file info.php in your HTML directory. Enter this text in

Download sample

Download