o'reilly - programming php

508 392 0
o'reilly - programming php

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... $big_long_variable_name = "PHP" ; $short =& $big_long_variable_name; $big_long_variable_name = " rocks!"; print "\$short is $short\n"; print "Long is $big_long_variable_name\n"; $short is PHP rocks! Long is PHP rocks! $short = "Programming $short"; print "\$short is $short\n"; print "Long is $big_long_variable_name\n"; $short is Programming PHP rocks! Long is Programming PHP rocks! After the assignment,... You’ll learn best-practices programming techniques here that will help you avoid mistakes that can lead to disaster Chapter 13, Application Techniques, talks about the advanced techniques that most PHP programmers eventually want to use, including error handling and performance tuning Chapter 14, Extending PHP, is an advanced chapter that presents easy-to-follow instructions for building a PHP extension... whirlwind tour of the core PHP language, covering such basic topics as data types, variables, operators, and flow control statements PHP is strongly influenced by other programming languages, such as Perl and C, so if you’ve had experience with those languages, PHP should be easy to pick up If PHP is one of your first programming languages, don’t panic We start with the basic units of a PHP program and build... All rights reserved ,ch02.15294 Page 25 Wednesday, March 13, 2002 11:42 AM PHP recognizes floating-point numbers written in two different formats There’s the one we all use every day: 3.14 0.017 -7 .1 but PHP also recognizes numbers in scientific notation: 0.314E1 17.0E-3 // 0.314*101, or 3.14 // 17.0*1 0-3 , or 0.017 Floating-point values are only approximate representations of numbers For example, on... is_null($newname)) { $this->name = $newname; } return $this->name; } } Once a class is defined, any number of objects can be made from it with the new keyword, and the properties and methods can be accessed with the -> construct: $ed = new Person; $ed->name('Edison'); printf("Hello, %s\n", $ed->name); $tc = new Person; $tc->name('Crapper'); printf("Look out below %s\n", $tc->name); Hello, Edison Look... language features powerful string- and array-handling facilities, as well as support for object-oriented programming With the use of standard and optional extension modules, a PHP application can interact with a database such as MySQL or Oracle, draw graphs, create PDF files, and parse XML files You can write your own PHP extension modules in C—for example, to provide a PHP interface to the functions... NULL old_function or parent PHP_ OS $PHP_ SELF PHP_ VERSION print require require_once return static stdClass switch $this TRUE var virtual while xor _ _FILE_ _ _ _LINE_ _ _ _sleep _ _wakeup $_COOKIE $_ENV $_FILES $_GET $_POST $_SERVER In addition, you cannot use an identifier that is the same as a built-in PHP function For a complete list of these, see Appendix A Data Types PHP provides eight types of... in hexadecimal numbers: 0xFF 0x10 -0 xDAD1 // decimal 255 // decimal 16 // decimal -5 6017 If you try to store a too-large integer in a variable, it will automatically be turned into a floating-point number Use the is_int( ) function (or its is_integer( ) alias) to test whether a value is an integer: if (is_int($x)) { // $x is an integer } Floating-Point Numbers Floating-point numbers (often referred to... run PHP on Windows, which lets you control other Windows applications such as Word and Excel with COM, or interact with databases using ODBC This book is a guide to the PHP language When you finish this book, you will know how the PHP language works, how to use the many powerful extensions that come standard with PHP, and how to design and build your own PHP web applications Audience for This Book PHP. .. and 2 appendixes, as follows Chapter 1, Introduction to PHP, talks about the history of PHP and gives a lightningfast overview of what is possible with PHP programs Chapter 2, Language Basics, is a concise guide to PHP program elements such as identifiers, data types, operators, and flow-control statements Chapter 3, Functions, discusses user-defined functions, including scoping, variablelength parameter . can learn PHP and can build powerful dynamic web sites with it. The core PHP language features powerful string- and array-handling facilities, as well as support for object-oriented programming. . Introduction to PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 What Does PHP Do? 1 A Brief History of PHP 2 Installing PHP 7 A Walk Through PHP 9 2 Introduction to PHP, talks about the history of PHP and gives a lightning- fast overview of what is possible with PHP programs. Chapter 2, Language Basics, is a concise guide to PHP program elements

Ngày đăng: 25/03/2014, 10:52

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan