Skip to main content
codingCourses
  • HTML
  • CSS
  • JavaScript
  • PHP
  • PHP Tutorial
  • PHP Strings
  • PHP Arrays
  • PHP URL
PHP
  • PHP Tutorial
  • echo vs. print
    Understanding echo and print Statement
  • include vs. require
    Differences and Usage
  • Superglobals
    Simple and Essential Usage Guide
  • Constants
    define() vs. const and Array Constants
  • isset() and empty()
    Concepts, Usage, and Key Differences
  • gettype()
    Get the Data Type of a Variable as a String
  • is_int()
    Check if Integer
  • is_float()
    Check if Float
  • is_numeric()
    Check if Numeric
  • is_string()
    Check if String
  • is_array()
    Check if Array
  • is_bool()
    Check if Boolean
  • is_object()
    Check if Object
  • is_resource()
    Check if Resource
  • is_null()
    Check if NULL
  • preg_replace()
    Replace Text Using Regexes
  • preg_match()
    Check if a String Matches a Regex
  • preg_match_all()
    Find All Matches of a Regex
  • preg_split()
    Split String Using Regexes
  • foreach Loop
    Iterating Over Arrays and Objects
  • Detecting Client Browser Info
    $_SERVER['HTTP_USER_AGENT']
  • Detecting Mobile Devices
    Working with Functions for Mobile Detection
  • Distinguishing Between iOS and Android
    Methods to Check if Running on iOS or Android
PHP Strings
  • String Reference
  • trim()
    Trim Whitespace
  • strpos()
    Find First Substring Index
  • mb_strpos()
    Multibyte-Safe Alternative to strpos()
  • stripos()
    Find First Substring Index (Case-Insensitive)
  • mb_stripos()
    Multibyte-Safe Alternative to stripos()
  • str_contains()
    Check if a String Contains a Substring
  • substr()
    Slice Strings by Position and Length
  • mb_substr()
    Multibyte-Safe Alternative to substr()
  • ctype_digit()
    Check if Only Numeric Character(s)
  • explode()
    Convert a String to an Array
  • str_split()
    Split String by Length
  • str_replace()
    Replace Text in a String
PHP Arrays
  • Array Reference
  • in_array()
    Check if a Value Exists in an Array
  • array_map()
    Ideal for mapping array data to new values
  • array_filter()
    Filter Elements with a Callback
  • array_reduce()
    Reducing an Array to a Single Value
  • array_key_exists()
    Check if a Key Exists in an Array
  • array_keys()
    Get a List of Array Keys
  • array_values()
    Get a List of Array Values
  • array_search()
    Searching for a Value in an Array
  • array_diff()
    Finding Array Differences by Value
  • array_diff_assoc()
    Comparing Array Differences by Key–Value
  • array_intersect()
    Finding Common Values Between Arrays
  • array_intersect_assoc()
    Find Common Elements by Key-Value
  • array_slice()
    Slicing an Array
  • array_shift()
    Remove the First Element from an Array
  • array_merge()
    Merging Arrays
  • array_pop()
    Remove the Last Element from an Array
  • array_unshift()
    Add Elements to the Start of an Array
  • array_push()
    Add Elements to the End of an Array
  • implode()
    Convert an Array to a String
PHP URL
  • PHP URL Reference
  • URL Encoding Functions
    Function Purpose & Features
  • urlencode()
    Encoding a URL Query Parameter Value
  • rawurlencode()
    Safely Encoding URI Components
  • http_build_query()
    Build Query Strings from Arrays or Objects
  • URL Decoding Functions
    Function Purpose & Features
  • urldecode()
    Decoding URLs Encoded with urlencode()
  • rawurldecode()
    Decoding URLs Encoded with rawurlencode()
  • parse_str()
    Parse URL Query Strings into Variables

PHP URL Reference

PHP Next

Learn how to handle URLs in PHP.

PHP URL Reference
URL Encoding Functions
Function Purpose & Features
PHP provides several functions for URL encoding, including the urlencode(), rawurlencode(), and http_build_query() functions, each with a distinct purpose and behavior.
urlencode()
Encoding a URL Query Parameter Value
The urlencode() function is used to encode a string for use as a URL query parameter value, making it ideal for passing variables between pages.
rawurlencode()
Safely Encoding URI Components
The rawurlencode() function encodes individual URI components—like search terms, filenames, or query values—according to RFC 3986.
http_build_query()
Build Query Strings from Arrays or Objects
The http_build_query() function encodes an array or object into a URL-compatible query string. It's especially useful when building HTTP requests or generating URLs from structured data.
URL Decoding Functions
Function Purpose & Features
PHP provides several functions for URL decoding, including urldecode(), rawurldecode(), and parse_str(), each with a distinct purpose and behavior.
urldecode()
Decoding URLs Encoded with urlencode()
The urldecode() function decodes a URL string that was previously encoded using urlencode(). It's typically used to decode URL query parameter values that have been passed in an encoded form.
rawurldecode()
Decoding URLs Encoded with rawurlencode()
The rawurldecode() function decodes a URL string that was previously encoded using rawurlencode(). It's typically used to decode URI components such as path segments or query parameter values.
parse_str()
Parse URL Query Strings into Variables
The parse_str() function parses a URL-encoded query string and stores the result as variables. It's typically used to decode strings generated by http_build_query().
PHP Next

codingCourses offers coding tutorials made for everyone.
All materials and examples are continuously reviewed to prevent errors; however, complete accuracy cannot be guaranteed.
Therefore, please carefully test and review all materials and examples to ensure they are free of errors, bugs, or vulnerabilities before relying on them.
They are available under the Creative Commons Attribution 4.0 International

Copyright © codingCourses. All Rights Reserved.