This series of tutorials covers everything you need to know to work with numbers and strings in PHP.
- 1Integer and Floating Point Numbers in PHP
- 24 Ways to Round a Number in PHP
- 3Mathematical Operations in PHP
- 4How to calculate exponential numbers in PHP
- 5How to format a number with leading zeros in PHP
- 6How to format a float number to 2 decimal places in PHP
- 7How to calculate Fibonacci in PHP
- 8PHP: How to convert integer to binary and vice versa
- 9PHP: How to Convert a String to a Number
- 10PHP: How to Convert a Number to Hex and Vice Versa
- 11PHP: How to create a random number between Min and Max
- 12PHP: How to generate N random numbers in a range
- 13PHP: How to calculate leap years
- 14PHP: How to convert numbers to bytes and vice versa
- 15PHP: Formatting large numbers with commas as thousand separators
- 16PHP: Extracting Numbers from Text (3 Approaches)
- 17PHP: Check if a number is a prime number
- 18PHP: Check if a Number is Integer or Float
- 19PHP: How to format a float to fixed width/length
- 20Explore built-in PHP functions to work with numbers
- 21PHP: Mapping numbers to words (e.g. 1 to ‘one’, 2 to ‘two’)
- 22PHP: Convert bytes to KB, MB, GB and vice versa
- 23PHP: Adding suffixes to numbers (e.g. 1st, 2nd, 3rd, 4th)
- 24PHP: Checking if a Number is Odd or Even
- 25PHP: Formatting thousand, million as K, M (e.g. 1k, 2m)
- 26PHP: 4 Ways to Check if a Number is in a Range
- 27PHP: Checking if a Number is Positive, Negative or Zero
- 28PHP: Extract Decimal and Integer Parts from a Float (3 Ways)
- 29PHP: Understanding scientific notation (e.g. 1.2e3)
- 30PHP error: Division by zero (4 solutions)
- 31PHP string built-in functions and methods cheat sheet
- 32Single-Quotes and Double-Quotes in PHP
- 33PHP: How to convert ‘\n’ to HTML ‘br’ tag
- 34PHP: How to create multiline strings
- 35PHP: How to convert a string to lowercase and uppercase
- 36PHP: How to get the length of a string
- 37PHP: 5 Ways to Check if a String is Empty
- 38PHP: 3 Ways to count the number of words in a string
- 39Slicing Strings in PHP: A Developer’s Guide
- 40Find and Replace Substrings in PHP: A Practical Guide
- 41PHP: Check if a string contains a substring
- 42Base64 Encoding and Decoding in PHP: A Complete Guide
- 43PHP: Convert a string to an array and vice versa
- 44PHP: Turn a string into an array of characters
- 45PHP: Convert a string to hex and vice versa
- 46PHP: Convert a string to binary and vice versa
- 47PHP: Convert a string to bytes and vice versa
- 48PHP: 4 Ways to Generate a Random String
- 49PHP: Remove leading and trailing whitespace from a string
- 50Exploring PHP Greedy Regex Quantifiers
- 51PHP: Remove multiple consecutive whitespaces from a string
- 52PHP: Remove multiple consecutive empty lines from a string
- 53PHP: 3 Ways to Validate an Email Address
- 54PHP: Get domain and username from an email address
- 55PHP: 3 Ways to Validate a URL
- 56PHP: 4 Ways to Validate an IP Address
- 57PHP: Get filename and file extension from a URL
- 58PHP: 3 Ways to Validate a Phone Number
- 59PHP: 3 Ways to Validate Credit Card Patterns
- 60PHP: Extract URLs from a string
- 61PHP: How to Escape Double Quotes in a String
- 62PHP: How to compare two strings case-insensitively
- 635 Ways to concatenate strings in PHP
- 64PHP: How to Mix a String with Variables
- 65PHP regular expressions cheat sheet
- 66PHP: How to iterate over characters in a string
- 67PHP: How to Convert a Title to a Slug
- 68PHP: Count the occurrences of a substring in a string
- 69Process escape sequences in a string in PHP
- 70How to reverse a string in PHP
- 71PHP: How to convert a string to char codes and vice versa
- 72PHP: How to remove HTML tags from a string
- 73PHP: Split a string into N evenly sized chunks
- 74PHP: Format price with currency symbol
- 75PHP: Get the size of a string in bytes
- 76PHP: Search and Replace Substrings in a File
- 77PHP: Check if a string starts or ends with another string
- 78PHP: How to Generate Random Hex Color Codes
- 79PHP: How to Unescape HTML Entities
- 80PHP: Get nth character of a string
- 81PHP: Generate a random string from a list of given characters
- 82PHP: How to format strings to fixed width
- 83PHP: Remove all non-alphanumeric characters from a string
- 84PHP: Convert query string to an object and vice versa
- 85PHP: Convert a string into an object and vice versa
- 86PHP: 2 ways to check if a string contains a number
- 87PHP: \r, \n, and \t – Explained with Examples
- 88PHP: Check if a string can be converted to a number
- 89PHP: Check if a string can be converted to date time
- 90PHP: Remove Accent Marks from a String
- 91PHP regex with word boundaries
- 92PHP regex with case-insensitive matching
- 93PHP Advanced Regex Examples
- 94PHP: How to Extract Domain, Protocol, and Path from URL