Main PHP Tutorial8+
Simple PHP Tutorial for Beginners with Taskbook and Solution Examples.
Basics
001
Introduction to the PHP Language for Beginners
002Getting Started With PHP
003PHP Code Execution
004The Problem with Encodings
005PHP Error Output
006Full Code for Running PHP
007Improved Code For Launching
008Overview of Basic PHP Commands
009Comments in PHP
010Comments in the Book
011Var_dump Function in PHP
012Functions in PHP
013Variables in PHP
014Using Variables in PHP
015Changing Variable Values in PHP
016Mathematical Operations with Numbers in PHP
017Mathematical Operations with Variables in PHP
018Priority of Mathematical Operations in PHP
019Equal Precedence in PHP
020Grouping Parentheses in PHP
021Nuances of Grouping in PHP
022Fractions in PHP
023Negative Numbers in PHP
024Modulo Operation in PHP
025Exponentiation in PHP
026Exponentiation Precedence in PHP
027Strings in PHP
028String Concatenation in PHP
029Spaces When Concatenating Strings in PHP
030String Length in PHP
031The Cyrillic Character Problem in PHP
032Working with HTML Tags in PHP
033Tag Attributes in PHP
034Logical Values in PHP
035The Null Value in PHP
036Automatic Type Conversion in PHP
037Automatic Conversion To String in PHP
038Nuances of String Conversion in PHP
039Type Casting to Integers in PHP
040Forced Conversion to Floating-Point Numbers in PHP
041Converting a Fraction to an Integer in PHP
042Converting a Number to a String in PHP
043Getting String Characters in PHP
044Numbers in a String in PHP
045Accessing Digits of a Number in PHP
046Nuances of Working with the Assignment Operation in PHP
047Shorthand Operations in PHP
048Increment and Decrement Operations in PHP
049Prefix and Postfix Types in PHP
050Search for errors in the code
051Practice on Operations in PHP
052Practice on Formulas in PHP
Arrays
053
Arrays in PHP
054How to View Array Contents in PHP
055Accessing an Array Element in PHP
056Associative Arrays in PHP
057A Trick With Keys in PHP
058Order of Elements in Arrays in PHP
059Array Length in PHP
060Modifying Array Elements in PHP
061Overwriting Array Elements in PHP
062Incrementing Array Elements in PHP
063Filling Arrays in PHP
064Explicit Key Specification in PHP
065Variable Keys in PHP
066Finding Errors in PHP Array Code
Conditions
067
If-Else Construct in PHP
068Greater Than and Less Than Operators in PHP
069Equality Check in PHP
070Checking for Inequality in PHP
071Comparison of Variables in PHP
072Data Types and the If-Else Construct in PHP
073Numbers in Quotes in PHP
074Value and Type Equality in PHP
075Inequality by Value and Type in PHP
076Nuances of Comparing Data Types in PHP
077Complex Conditions in If-Else in PHP
078Logical AND in PHP
079Logical OR in PHP
080Priority of Comparison Operations in PHP
081Grouping Conditions in PHP
082Inverting Statements in If-Else
083If-Else Construct and Boolean Values
084Non-Strict Comparison of Boolean Values in PHP
085Shorthand If in If-Else Construct
086Nuances of Shorthand Operations in PHP
087Isset Command in PHP
088Suppressing Warnings in PHP
089Checking the Existence of an Array Element in PHP
090The empty Command in PHP
091The Optional Else Command in PHP
092Optionality of Curly Braces in Conditions in PHP
093The Problem of Optional Curly Braces in Conditions in PHP
094Combinations of If-Else Constructs in PHP
095Elseif Construct in PHP
096Nested If Statements in PHP
097Switch-Case Construct in PHP
098Optionality of Default in PHP
099Match Construct in PHP
100Optionality of Break in PHP
101Ternary Operator in PHP
102Null Coalescing Operator in PHP
103Null Coalescing Operator Chains in PHP
104Logical Operations in PHP
105Determining a Part of an Hour in PHP
106Checking the Length of Strings and Arrays in PHP
107Checking a String Character in PHP
108Checking the Remainder of Division in PHP
109Search for errors in the with conditions in JavaScript
110Practice on If-Else Conditions in PHP
Loops
111
Introduction to Loops in PHP
112Foreach Loop in PHP
113Keys in the Foreach Loop in PHP
114The While Loop in PHP
115For Loop in PHP
116Conditions in Loops in PHP
117Accumulating Numbers in PHP Loops
118Accumulating Array Elements in PHP Loops
119String Formation Through Loops in PHP
120Optionality of Braces in Loops in PHP
121The Problem of Curly Braces in Loops in PHP
122The Break Statement in PHP
123The Continue Statement in PHP
124Working with Flags in PHP
125Nested Loops in PHP
126For Loop for Arrays in PHP
127Filling Arrays in PHP
128Modifying an Array in a PHP Loop
129Tips for Writing Loop Code in PHP
130Finding Errors in PHP Loop Code
131PHP Loops Practice
Multidimensionality
132
Multidimensional Arrays in PHP
133Three-Dimensional Array in PHP
134Associative Arrays in PHP
135Arbitrary Arrays in PHP
136Iterating Over Multidimensional Arrays in PHP
137Iterating Over a Three-Dimensional Array in PHP
138Working with Keys in Multidimensional Arrays in PHP
139Filling Multidimensional Arrays in PHP
140Filling Multidimensional Arrays with Numbers in Order in PHP
141Array of Associative Arrays in PHP
142Conversion of Multidimensional Arrays in PHP
Mathematical Functions
String Functions
148
String Length in PHP
149Character Case in PHP
150String Cutting in PHP
151String Checking in PHP
152String Search in PHP
153String Splitting in PHP
154Trimming Line Ends in PHP
155Outputting a String with Insertion in PHP
156Formatting a Number in PHP
157String Reversal in PHP
158String Padding in PHP
159Functions for HTML Tags in PHP
160Character Codes in PHP
161Counting Substrings in PHP
162String Parts in PHP
Array Functions
163
Searching in Arrays in PHP
164Boundary Elements in PHP
165Array Slicing in PHP
166Splicing Arrays in PHP
167Range to Array in PHP
168Filling Arrays in PHP
169Merging Arrays in PHP
170Array Keys and Values in PHP
171Reversing Arrays in PHP
172Replacement in Arrays in PHP
173Removing Duplicates from an Array in PHP
174Counting Array Elements in PHP
175Array Partitioning in PHP
176Sorting Arrays in PHP
177Multiple Operations in PHP
Random
Time
182
Working With Timestamp in PHP
183Formatting Date and Time in PHP
184Parsing Dates in Free Format in PHP
185Checking Date Validity in PHP
186Time Zone in PHP
187Date Modification in PHP
188Comparing Date Strings in PHP
189Comparing Date Without Year in PHP
190Date Range Check in PHP
191Comparing Timestamp with Time Points in PHP
Custom Functions
192
Basics of Working with User-Defined Functions in PHP
193Function Parameters in PHP
194Multiple Function Parameters in PHP
195Variable Parameters of Functions in PHP
196Optional Function Parameters in PHP
197The Return Statement in PHP
198Sequential Function Calls in PHP
199The Subtle Point of Return in PHP
200Loop and Return in PHP
201Using Return in a Loop in PHP
202Techniques for Working with Return in PHP
203Flags in PHP Functions
204Logical Operators Without If in PHP Functions
205Tips for Creating Functions in PHP
206Finding errors in code with functions in JavaScript
207Practice on PHP Functions
Scope
Recursion
Regular Expressions
223
Introduction to Regular Expressions in PHP
224Character Repetition Operators in Regex
225Grouping Parentheses in PHP Regex
226Escaping Special Characters in PHP Regex
227List of Special Characters in Regex in PHP
228Curly Braces in PHP Regular Expressions
229Limiting Greediness in Regex in PHP
230Character Groups in PHP Regular Expressions
231Character Sets in PHP Regular Expressions
232Inverting Character Sets in Regex
233Features of Cyrillic in PHP Regular Expressions
234Special Characters Inside Square Brackets in PHP
235Character Groups Inside Square Brackets in PHP
236Exceptions Inside Character Classes in PHP Regex
237The Caret Symbol Inside Character Classes in PHP Regex
238Hyphen Inside Sets in PHP Regex
239Start and End of String in PHP Regex
240The End or Beginning of a Word in PHP Regular Expressions
241The 'or' Command in PHP Regular Expressions
242Delimiters of Regular Expressions in PHP
243Escaping Delimiters in PHP
244The Backslash Problem in PHP
245Checking a String with a Regex in PHP
246Automatic Testing of Regex in PHP
247Checking the Entire String with Regular Expressions in PHP
248Pockets When Searching via Regular Expressions in PHP
249Finding All Matches with Regular Expressions in PHP
250All Matches into Subpatterns via Regular Expressions in PHP
251Changing preg_match_all Behavior in PHP
252Non-Capturing Parentheses in PHP Regex
253Pockets in Replacement via Regular Expressions in PHP
254Pockets in Regular Expressions in PHP
255Named Capturing Groups in PHP Regex
256Named Capturing Groups Inside PHP Regex
257Common Number of Capture Groups in PHP Regex
258Lookahead in PHP Regex
259Lookbehind in PHP Regex
260Replacement With Callback Using Regular Expressions in PHP
261Regular Expression Modifiers in PHP
262Ignoring Case in Regex in PHP
263Comments in Regex in PHP
264Working with Unicode in Regular Expressions in PHP
265Changing Regex Greediness in PHP
266Escaping Ordinary Characters in Regex in PHP
267Several Regex Modifiers in PHP
268Automatic Escaping of Special Regex Characters in PHP
269Filtering an Array Using Regular Expressions in PHP
270Splitting a String into an Array Using Regular Expressions in PHP
Forming Strings
271
Inserting Variables into Strings in PHP
272Inserting Array Elements in PHP
273Inserting Associative Array Elements in PHP
274Loop and Variable Interpolation in PHP
275Inserting Array Elements in a Loop in PHP
276Inserting Multidimensional Array Elements in a Loop in PHP
277Tag Generation in PHP
278Generating Tags with Attributes in PHP
279Loop and Tag Generation in PHP
280Loop and Tag Generation from Arrays in PHP
281Loop and Generation of Tags and Attributes in PHP
282Loop and HTML Table Generation in PHP
283Generating an HTML Table Using a Single Loop in PHP
284Generating an HTML Table Using Two Nested Loops in PHP
285Inserting PHP Code into HTML
286Short Echo Command in PHP
287Inserting a PHP Variable into HTML Code
288Inserting Array Elements into HTML Code
289Conditions and Breaking PHP Code
290Else Block in Conditions for Breaking PHP Code
291Elseif Block in Conditions for Breaking PHP Code
292Loops and Breaking PHP Code
293Loops and Inserting Array Elements into PHP Code Break
Forms
294
Basics of Working with Forms in PHP
295Form Submission Method in PHP
296Retrieving Form Data in PHP
297Retrieving Form Data Using the GET Method in PHP
298Retrieving Form Data Using the POST Method in PHP
299Form Processing in a Single PHP File
300Hiding the Form After Submission in PHP
301Saving Form Values After Submission in PHP
302Saving Form Default Value in PHP
303Shortened Code for Saving Default Values in PHP
304Textarea Element in PHP
305Saving Textarea Value After Submission in PHP
306Checkbox in PHP
307Nuances of Using Checkboxes in PHP
308Saving the Selected Value in a Checkbox After Submission in PHP
309Radio Buttons in PHP
310Saving the Selected Value in Radio Buttons After Submission in PHP
311Selects in PHP
312The Value Attribute in Selects in PHP
313Saving the Value in Selects After Submission in PHP
314GET Requests in PHP
315GET Requests Using Links in PHP
316Practice on Forms in PHP
Sessions
Cookies
File System
331
Reading Files in PHP
332Writing Files in PHP
333Combination of File Read and Write Operations in PHP
334Relative Paths in PHP
335Absolute Paths in PHP
336Advantages of Absolute Path in PHP
337Absolute Paths to the Script Folder and File in PHP
338Renaming Files in PHP
339Moving Files in PHP
340Copying Files in PHP
341Deleting Files in PHP
342Determining File Sizes in PHP
343Checking File Existence in PHP
344Creating Folders in PHP
345Deleting Folders in PHP
346Renaming Folders in PHP
347Moving Folders in PHP
348Reading Directory Contents in PHP
349Distinguishing a Folder from a File in PHP
350Analyzing Folder Contents in PHP
351Inserting Files in PHP
352Dividing Layout into Elements in PHP
353Writing Include to Variable in PHP
354Including Files in PHP
355Single File Inclusion in PHP
356Storing Include Result in a Variable in PHP
Databases
357
Introduction to SQL Databases in PHP for Beginners
358Working With Databases Through PhpMyAdmin
359Test Table Users
360Preparatory Manipulations for Working with SQL in PHP
361Sending Requests to the Database
362Finding Errors in the Database
363Database Functionality Testing
364Encoding Issues When Working With SQL in PHP
365Augmented Test Code for Functionality Check
366Getting the Result of an SQL Query in PHP
367Getting the Result as an Array from an SQL Query in PHP
368Forming an Array in a Loop with an SQL Query in PHP
369Selecting Records with SQL Query to Database in PHP
370Logical Operations in SQL Query in PHP
371Selection Fields in SQL Query in PHP
372Inserting Records via SQL Query in PHP
373Inserting Records with Missing Columns via SQL Query in PHP
374Updating Records via SQL Query in PHP
375Deleting Records via SQL Query in PHP
376Sorting Records via SQL Query in PHP
377Limiting the Number of Records in SQL in PHP
378Counting Records via SQL Query in PHP
379Getting Count in PHP
380Learning Advanced SQL Queries
Database Organization
381
Linking Tables in Databases
382Retrieving Data From Related Tables in PHP
383Chain of Linked Tables
384Linking Through a Junction Table in PHP
385Data Relationships in PHP
386Multiple Descendants in Family Relationships in PHP
387Double Relationship With One Table in PHP
388Practice on Database Organization
Database Practice
Working with HTTP
395
Protocol HTTP in PHP
396HTTP Request Method in PHP
397HTTP Request Headers in PHP
398Array of HTTP Request Headers in PHP
399HTTP Response Headers in PHP
400The Problem With HTTP Response Headers in PHP
401The Problem With HTTP Headers When Using Include in PHP
402Sending the HTTP Response Start Line in PHP
403Returning HTTP Response Status in PHP
Redirects
404
Introduction to PHP Redirects
405Instant Redirect in PHP
406GET Requests and Redirect in PHP
407Self-Redirect With Adding Parameters in PHP
408Flash Messages in PHP
409Flash Messages Array in PHP
410Form Submission to Database and Redirect in PHP
411Success Messages on Form Submission in PHP
412Redirect on Form Validation in PHP
Authentication
413
Introduction to Authentication in PHP
414Simple Authorization via Database in PHP
415Authorization via Session in PHP
416Logging Out of a Session in PHP
417Registration in PHP
418Authorization Immediately Upon Registration in PHP
419Adding User Id to Session
420Hiding Password During Registration in PHP
421Checking Login Availability
422Data Validation During Registration in PHP
423Password Hashing in PHP
424Adding Salt to Registration
425Adding Salt to Authorization
426Password_hash Function
427Profile Implementation in PHP
428Personal Account in PHP
429Changing Password in PHP
430Password Confirmation in PHP
431Account Deletion in PHP
432Access Rights in PHP
433Registration With User Rights Separation in PHP
434Database Normalization
Site Engine
435