tailieunhanh - PHP and MySQL Web Development - P3

PHP and MySQL Web Development - P3: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | Contents xi Associative Arrays 74 Initializing an Associative Array 74 Accessing the Array Elements 74 Using Loops with Associative Arrays 75 Multidimensional Arrays 77 Sorting Arrays 80 Using sort 80 Using asort and ksort to Sort Associative Arrays 81 Sorting in Reverse 81 Sorting Multidimensional Arrays 82 User Defined Sorts 82 Reverse User Sorts 83 Reordering Arrays 84 Using shuffle 84 Using array_reverse 86 Loading Arrays from Files 86 Other Array Manipulations 89 Navigating Within an Array each current reset end next pos and prev 90 Applying Any Function to Each Element in an Array array_walk 90 Counting Elements in an Array count sizeof and array_count_values 92 Converting Arrays to Scalar Variables extract 92 Further Reading 94 Next 94 4 String Manipulation and Regular Expressions 95 Example Application Smart Form Mail 95 Formatting Strings 97 Trimming Strings chop ltrim and trim 98 Formatting Strings for Presentation 98 Formatting Strings for Storage AddSlashes and StripSlashes 101 xii Contents Joining and Splitting Strings with String Functions 103 Using explode implode and join 103 Using strtok 104 Using substr 104 Comparing Strings 105 String Ordering strcmp strcasecmp and str- natcmp 105 Testing String Length with strlen 106 Matching and Replacing Substrings with String Functions 106 Finding Strings in Strings strstr strchr str-rchr stristr 107 Finding the Position of a Substring strpos str- rpos 107 Replacing Substrings str_replace substr_replace 108 Introduction to Regular Expressions 109 The Basics 110 Character Sets and Classes 110 Repetition 112 Subexpressions 112 Counted Subexpressions 112 Anchoring to the Beginning or End of a String 112 Branching 113 Matching Literal Special Characters 113 Summary of Special Characters 113 Putting It All Together for the Smart Form 114 Finding Substrings with Regular Expressions 115 Replacing Substrings with Regular Expressions 115 Splitting Strings with Regular Expressions 116 Comparison of String Functions and

TỪ KHÓA LIÊN QUAN