Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ag-sanjjeev/php-notes
This repository contains PHP topics and their notes to learn from beginner level to advanced level.
https://github.com/ag-sanjjeev/php-notes
advanced-topics core-concepts database-integration fundamentals learn-php notes object-oriented-programming php php-notes
Last synced: about 5 hours ago
JSON representation
This repository contains PHP topics and their notes to learn from beginner level to advanced level.
- Host: GitHub
- URL: https://github.com/ag-sanjjeev/php-notes
- Owner: ag-sanjjeev
- License: mit
- Created: 2024-09-13T08:00:58.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-14T07:00:59.000Z (6 days ago)
- Last Synced: 2024-11-14T08:17:31.108Z (6 days ago)
- Topics: advanced-topics, core-concepts, database-integration, fundamentals, learn-php, notes, object-oriented-programming, php, php-notes
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: docs/security-best-practices.md
Awesome Lists containing this project
README
# PHP NOTES
This repository contains PHP topics and their notes to learn from beginner level to advanced level.
*Refer the below contents, To kick start the learning of important concepts in PHP for web application development. which gives you __step by step__ approach to the concepts.*
\
## ☰ CONTENTS
### Fundamentals
1. [Introduction:](./introduction.md)
- [What is PHP?](./introduction.md#-what-is-php)
- [History and evolution](./introduction.md#-history-and-evolution)
- [Role in Web Development](./introduction.md#-role-in-web-development)
- [Benefits of Using PHP](./introduction.md#-benefits-of-using-php)
2. [Basic Syntax:](./docs/basic-syntax.md)
- [Variables](./docs/basic-syntax.md#-variables)
- [Data Types](./docs/basic-syntax.md#-data-types)
- [Strings](./docs/basic-syntax.md#-strings)
- [Operators](./docs/basic-syntax.md#-operators)
3. [Comments:](./docs/comments.md)
- [Single Line Comments](./docs/comments.md#-single-line-comments)
- [Multi Line Comments](./docs/comments.md#-multi-line-comments)
- [Doc Comments](./docs/comments.md#-doc-comments)
- [Hash Comments](./docs/comments.md#-hash-comments)
4. [Control flow:](./docs/control-flow.md)
- [If Else Statements](./docs/control-flow.md#-if-else-statements)
- [Nested If Else Statements](./docs/control-flow.md#-nested-if-else-statements)
- [Switch Statements](./docs/control-flow.md#-switch-statements)
5. [Functions:](./docs/functions.md)
- [Function Definition](./docs/functions.md#-function-definition)
- [Function Calling](./docs/functions.md#-function-calling)
- [Function Arguments and Parameters](./docs/functions.md#-function-arguments-and-parameters)
- [Function Return Values](./docs/functions.md#-function-return-values)
- [Pass by Value](./docs/functions.md#-pass-by-value)
- [Pass by Reference](./docs/functions.md#-pass-by-reference)
- [Scope of Variables](./docs/functions.md#-scope-of-variables)
- [Variable Length Argument Lists](./docs/functions.md#-variable-length-argument-lists)
- [Anonymous Functions](./docs/functions.md#-anonymous-functions)
- [Recursion](./docs/functions.md#-recursion)
- [Variable Functions](./docs/functions.md#-variable-functions)
- [Type Hinting](./docs/functions.md#-type-hinting)
- [Return Type Declarations](./docs/functions.md#-return-type-declarations)
- [Generators](./docs/functions.md#-generators)
- [Arrow Functions](./docs/functions.md#-arrow-functions)
- [String Functions](./docs/functions.md#-string-functions)
- [Mathematical Functions](./docs/functions.md#-mathematical-functions)
- [Date and Time Functions](./docs/functions.md#-date-and-time-functions)
- [File and Directory Functions](./docs/functions.md#-file-and-directory-functions)
- [Array Functions](./docs/functions.md#-array-functions)
- [Other Common Functions](./docs/functions.md#-other-common-functions)
6. [Arrays:](./docs/arrays.md)
- [Array Types](./docs/arrays.md#-array-types)
- [Indexed Array](./docs/arrays.md#-indexed-array)
- [Associative Array](./docs/arrays.md#-associative-array)
- [Multi Dimensional Array](./docs/arrays.md#-multi-dimensional-array)
- [Choosing Array](./docs/arrays.md#-choosing-array)
- [Adding Elements in Array](./docs/arrays.md#-adding-elements-in-array)
- [Accessing Array Elements](./docs/arrays.md#-accessing-array-elements)
- [Array Elements Unpack](./docs/arrays.md#-array-elements-unpack)
- [Iterating Array Elements](./docs/arrays.md#-iterating-array-elements)
- [Common Array Functions](./docs/arrays.md#-common-array-functions)
7. [Short-Hand Syntax:](./docs/short-hand-syntax.md)
- [Ternary Operator](./docs/short-hand-syntax.md#-ternary-operator)
- [Null Coalescing Operator](./docs/short-hand-syntax.md#-null-coalescing-operator)
- [Null Coalescing Assignment Operator](./docs/short-hand-syntax.md#-null-coalescing-assignment-operator)
- [Short Echo Tag](./docs/short-hand-syntax.md#-short-echo-tag)
- [Spaceship Operator](./docs/short-hand-syntax.md#-spaceship-operator)
- [Short-Hand Control Structures](./docs/short-hand-syntax.md#-short-hand-control-structures)### Core PHP Concepts
1. [Super globals:](./docs/super-globals.md)
- [GET Variable](./docs/super-globals.md#-get-variable)
- [POST Variable](./docs/super-globals.md#-post-variable)
- [REQUEST Variable](./docs/super-globals.md#-request-variable)
- [FILES Variable](./docs/super-globals.md#-files-variable)
- [SESSION Variable](./docs/super-globals.md#-session-variable)
- [COOKIE Variable](./docs/super-globals.md#-cookie-variable)
- [SERVER Variable](./docs/super-globals.md#-server-variable)
- [ENV Variable](./docs/super-globals.md#-env-variable)
2. [Forms and Data Handling:](./docs/forms-and-data-handling.md)
- [Creating Forms](./docs/forms-and-data-handling.md#-creating-forms)
- [Handling Forms](./docs/forms-and-data-handling.md#-handling-forms)
- [Processing Data](./docs/forms-and-data-handling.md#-processing-data)
- [Input Validation](./docs/forms-and-data-handling.md#-input-validation)
- [Input Sanitization](./docs/forms-and-data-handling.md#-input-sanitization)
- [Filter Variable Flags](./docs/forms-and-data-handling.md#-filter-variable-flags)
- [Prevent Duplicate Form Submission](./docs/forms-and-data-handling.md#-prevent-duplicate-form-submission)
3. [Headers:](./docs/headers.md)
- [Setting a Header](./docs/headers.md#-setting-a-header)
- [Common Headers](./docs/headers.md#-common-headers)
- [Content Type](./docs/headers.md#-content-type)
- [Redirection](./docs/headers.md#-redirection)
- [Cache Control](./docs/headers.md#-cache-control)
- [Order of Usage](./docs/headers.md#-order-of-usage)
- [Headers with Output Buffers](./docs/headers.md#-headers-with-output-buffers)
- [Security Headers](./docs/headers.md#-security-headers)
4. [HTTP Status Code:](./docs/http-status-code.md)
- [1xx Information](./docs/http-status-code.md#-1xx-information)
- [2xx Success](./docs/http-status-code.md#-2xx-success)
- [3xx Redirection](./docs/http-status-code.md#-3xx-redirection)
- [4xx Client Error](./docs/http-status-code.md#-4xx-client-error)
- [5xx Server Error](./docs/http-status-code.md#-5xx-server-error)
- [Usage](./docs/http-status-code.md#-usage)
5. [Sessions:](./docs/sessions.md)
- [Need and Usage](./docs/sessions.md#-need-and-usage)
- [Creating Session](./docs/sessions.md#-creating-session)
- [Storing Data in Session](./docs/sessions.md#-storing-data-in-session)
- [Retrieving Data from Session](./docs/sessions.md#-retrieving-data-from-session)
- [Removing Session Data](./docs/sessions.md#-removing-session-data)
- [Destroying Session](./docs/sessions.md#-destroying-session)
- [Pros](./docs/sessions.md#-pros)
- [Cons](./docs/sessions.md#-cons)
- [Functions Related To Session](./docs/sessions.md#-functions-related-to-session)
- [Constants Related To Session](./docs/sessions.md#-constants-related-to-session)
- [Configuration Flags Related To Session](./docs/sessions.md#-configuration-flags-related-to-session)
- [Different Session Handling Techniques](./docs/sessions.md#-different-session-handling-techniques)
- [Secure Session Handling](./docs/sessions.md#-secure-session-handling)
- [Strong Session Name](./docs/sessions.md#-strong-session-name)
- [Session Handlers](./docs/sessions.md#-session-handlers)
- [Example For Custom Session Handlers](./docs/sessions.md#-example-for-custom-session-handlers)
- [Protecting Against Session Fixation](./docs/sessions.md#-protecting-against-session-fixation)
6. [Cookies:](./docs/cookies.md)
- [Need and Usage](./docs/cookies.md#-need-and-usage)
- [Creating a cookie](./docs/cookies.md#-creating-a-cookie)
- [Modifying a cookie](./docs/cookies.md#-modifying-a-cookie)
- [Deleting a cookie](./docs/cookies.md#-deleting-a-cookie)
- [Pros](./docs/cookies.md#-pros)
- [Cons](./docs/cookies.md#-cons)
7. [File Handling:](./docs/file-handling.md)
- [Handling Directory](./docs/file-handling.md#-handling-directory)
- [Handling File](./docs/file-handling.md#-handling-file)
- [Uploading a file](./docs/file-handling.md#-uploading-a-file)
- [Downloading a file](./docs/file-handling.md#-downloading-a-file)
- [File Handling Flags](./docs/file-handling.md#-file-handling-flags)
- [Common File Handling Functions](./docs/file-handling.md#-common-file-handling-functions)
- [Security Considerations](./docs/file-handling.md#-security-considerations)
8. [Include and Require Statements:](./docs/include-and-require-statements.md)
- [Include Statement](./docs/include-and-require-statements.md#-include-statement)
- [Require Statement](./docs/include-and-require-statements.md#-require-statement)
- [Differences Between Statements](./docs/include-and-require-statements.md#-differences-between-statements)
9. [Error Handling and Debugging:](./docs/error-handling-and-debugging.md)
- [Identifying Errors](./docs/error-handling-and-debugging.md#-identifying-errors)
- [Debugging Techniques](./docs/error-handling-and-debugging.md#-debugging-techniques)
- [Error Levels](./docs/error-handling-and-debugging.md#-error-levels)
- [Log Levels](./docs/error-handling-and-debugging.md#-log-levels)
- [Logging to a File](./docs/error-handling-and-debugging.md#-logging-to-a-file)
- [Logging to a Database](./docs/error-handling-and-debugging.md#-logging-to-a-database)
- [Error Logging Formats](./docs/error-handling-and-debugging.md#-error-logging-formats)
- [Key Points](./docs/error-handling-and-debugging.md#-key-points)
- [Log Rotation](./docs/error-handling-and-debugging.md#-log-rotation)### Object-Oriented Programming in PHP
1. [Classes and Objects:](./docs/classes-and-objects.md)
- [Defining Classes](./docs/classes-and-objects.md#-defining-classes)
- [Properties and Methods](./docs/classes-and-objects.md#-properties-and-methods)
- [Creating Objects](./docs/classes-and-objects.md#-creating-objects)
- [Object Destruction](./docs/classes-and-objects.md#-object-destruction)
- [Key Points](./docs/classes-and-objects.md#-key-points)
2. [Inheritance:](./docs/inheritance.md)
- [Extending Classes](./docs/inheritance.md#-extending-classes)
- [Overriding Methods](./docs/inheritance.md#-overriding-methods)
- [Key Points](./docs/inheritance.md#-key-points)
3. [Polymorphism:](./docs/polymorphism.md)
- [Method Overloading](./docs/polymorphism.md#-method-overloading)
- [Method Overriding](./docs/polymorphism.md#-method-overriding)
4. [Encapsulation:](./docs/encapsulation.md)
- [Access Modifiers](./docs/encapsulation.md#-access-modifiers)
- [Public](./docs/encapsulation.md#-public)
- [Protected](./docs/encapsulation.md#-protected)
- [Private](./docs/encapsulation.md#-private)
5. [Abstraction:](./docs/abstraction.md)
- [Abstract Classes](./docs/abstraction.md#-abstract-classes)
- [Interfaces](./docs/abstraction.md#-interfaces)
- [Traits](./docs/abstraction.md#-traits)
- [Key Points](./docs/abstraction.md#-key-points)
- [Real World Usages](./docs/abstraction.md#-real-world-usages)
6. [Namespace:](./docs/namespace.md)
- [Use of Namespace](./docs/namespace.md#-use-of-namespace)
- [Global Namespace](./docs/namespace.md#-global-namespace)
- [Declaration of Namespace](./docs/namespace.md#-declaration-of-namespace)
- [Implementation of Namespace](./docs/namespace.md#-implementation-of-namespace)
- [Namespace Alias](./docs/namespace.md#-namespace-alias)
- [Key Points](./docs/namespace.md#-key-points)
7. [Autoload in PHP:](./docs/autoload-in-php.md)
- [Built-in Autoloader](./docs/autoload-in-php.md#-built-in-autoloader)
- [How it works](./docs/autoload-in-php.md#-how-it-works)
8. [Composer:](./docs/composer.md)
- [Dependency Management](./docs/composer.md#-dependency-management)
- [Autoloading](./docs/composer.md#-autoloading)
- [Handling Packages](./docs/composer.md#-handling-packages)
- [Basic Usage](./docs/composer.md#-basic-usage)
- [Composer Commands and Flags](./docs/composer.md#-composer-commands-and-flags)### Database Integration
1. [Database Abstraction Layers:](./docs/database-abstraction-layers.md)
- [PDO](./docs/database-abstraction-layers.md#-pdo)
- [Prepared Statements](./docs/database-abstraction-layers.md#-prepared-statements)
- [Positional and Parameterized Queries](./docs/database-abstraction-layers.md#-positional-and-parameterized-queries)
2. [PHP-MySQL Integration:](./docs/php-mysql-integration.md)
- [MySQL Overview](./docs/php-mysql-integration.md#-mysql-overview)
- [Connecting to a MySQL Database](./docs/php-mysql-integration.md#-connecting-to-a-mysql-database)
- [Executing SQL Queries](./docs/php-mysql-integration.md#-executing-sql-queries)
- [Updating and Deleting Data](./docs/php-mysql-integration.md#-updating-and-deleting-data)### Web Development with PHP
1. [Remember Logged In User:](./docs/remember-logged-in-user.md)
- [Best Practice](./docs/remember-logged-in-user.md#-best-practice)
- [Session Management](./docs/remember-logged-in-user.md#-session-management)
- [Generate Unique ID](./docs/remember-logged-in-user.md#-generate-unique-id)
- [Regenerate Unique ID](./docs/remember-logged-in-user.md#-regenerate-unique-id)
- [Set Unique ID](./docs/remember-logged-in-user.md#-set-unique-id)
- [Check for Unique ID](./docs/remember-logged-in-user.md#-check-for-unique-id)
- [Expiry Remember Token](./docs/remember-logged-in-user.md#-expiry-remember-token)
- [Remove Remember Token](./docs/remember-logged-in-user.md#-remove-remember-token)
2. [Web Frameworks:](./docs/web-frameworks.md)
- [Need of Framework in PHP](./docs/web-frameworks.md#-need-of-framework-in-php)
- [Popular Frameworks](./docs/web-frameworks.md#-popular-frameworks)
3. [MVC Architecture:](./docs/mvc-architecture.md)
- [Understanding MVC Architecture](./docs/mvc-architecture.md#-understanding-mvc-architecture)
- [Building MVC](./docs/mvc-architecture.md#-building-mvc)
- [How it works](./docs/mvc-architecture.md#-how-it-works)
- [Advantages of MVC](./docs/mvc-architecture.md#-advantages-of-mvc)
4. [Security Best Practices:](./docs/security-best-practices.md)
- [Common Web Attacks](./docs/security-best-practices.md#-common-web-attacks)
- [Protecting Applications](./docs/security-best-practices.md#-protecting-applications)### Advanced Topics
1. [Regular Expressions:](./docs/regular-expressions.md)
- [Pattern Matching](./docs/regular-expressions.md#-pattern-matching)
- [Find and Replacing Text](./docs/regular-expressions.md#-find-and-replacing-text)
- [Extracting Text](./docs/regular-expressions.md#-extracting-text)
- [Validate Text](./docs/regular-expressions.md#-validate-text)
- [Common Patterns](./docs/regular-expressions.md#-common-patterns)
2. [Cryptographic Functionalities:](./docs/cryptographic-functionalities.md)
- [Random Unique ID Generation](./docs/cryptographic-functionalities.md#-random-unique-id-generation)
- [Hashing and Salting](./docs/cryptographic-functionalities.md#-hashing-and-salting)
- [HMAC](./docs/cryptographic-functionalities.md#-hmac)
- [Encryption and Decryption](./docs/cryptographic-functionalities.md#-encryption-and-decryption)
3. [XML and JSON:](./docs/xml-and-json.md)
- [Parsing XML](./docs/xml-and-json.md#-parsing-xml)
- [Parsing JSON](./docs/xml-and-json.md#-parsing-json)
- [Generating XML](./docs/xml-and-json.md#-generating-xml)
- [Generating JSON](./docs/xml-and-json.md#-generating-json)
- [Key Points](./docs/xml-and-json.md#-key-points)
4. [CLI with PHP:](./docs/cli-with-php.md)
- [Executing PHP Script in Command Line](./docs/cli-with-php.md#-executing-php-script-in-command-line)
- [Accepting Command Line Arguments](./docs/cli-with-php.md#-accepting-command-line-arguments)
- [Common PHP CLI Options](./docs/cli-with-php.md#-common-php-cli-options)
5. [Performance optimization:](./docs/performance-optimization.md)
- [Caching Techniques](./docs/performance-optimization.md#-caching-techniques)
- [Code Optimization](./docs/performance-optimization.md#-code-optimization)By following this road map and consistently practicing, you can develop a strong foundation in PHP and build impressive web applications. For better understanding and double check with Official [PHP manual](https://www.php.net/manual/en/index.php), Before proceed in real-time implementations.
## ⚑ Contribution
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request. Make sure to follow the existing coding style and provide clear documentation for your changes.## ⚑ License
This reference licensed under the [MIT license](LICENSE). Feel free to use, modify, and distribute it as per the terms of the license.## ⚑ Contact
If you have any questions or need further assistance, please feel free to reach me by referring [My Github Profile](https://github.com/ag-sanjjeev/)Thanks for reviewing this reference notes!