PHP Cookbook

PHP Cookbook

4.11 - 1251 ratings - Source

Want to understand a certain PHP programming technique? Or learn how to accomplish a particular task? This cookbook is the first place to look. With more than 350 code-rich recipes revised for PHP 5.4 and 5.5, this third edition provides updated solutions for generating dynamic web contenta€”everything from using basic data types to querying databases, and from calling RESTful APIs to testing and securing your site. Each recipe includes code solutions that you can freely use, along with a discussion of how and why they work. Whether youa€™re an experienced PHP programmer or coming to PHP from another language, this book is an ideal on-the-job resource. Youa€™ll find recipes to help you with: Basic data types: strings, numbers, arrays, and dates and times Program building blocks: variables, functions, classes, and objects Web programming: cookies, forms, sessions, and authentication Database access using PDO, SQLite, and other extensions RESTful API clients and servers, including HTTP, XML, and OAuth Key concepts: email, regular expressions, and graphics creation Designing robust applications: security and encryption, error handling, debugging and testing, and performance tuning Files, directories, and PHPa€™s Command Line Interface Libraries and package managers such as Composer and PECLValidating a credit card number function is_valid_credit_card($s) { //Remove non- digits andreverse $s= ... $sum += $val; } // Number is valid ifsumis a multipleof ten return (($sum % 10) == 0); } if (! is_valid_credit_card($_POST[a#39;credit_carda#39;])) { print a#39;Sorry, that ... Ita#39;sa wellknown test numberthat looks like a Visa card number.

Title:PHP Cookbook
Author:David Sklar, Adam Trachtenberg
Publisher:"O'Reilly Media, Inc." - 2014-06-30


You Must CONTINUE and create a free account to access unlimited downloads & streaming