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