- BASICS
- Quotes
- Constants
- Control Structures
- Reference
- Number Systems
- VARIABLES
- Definition
- Variable Variable
- Exists
- Type Casting
- OPERATORS
- Aritmetic
- Bitwise
- String
- Comparison
- Logical
- FUNCTION
- Definition
- Anonymous
- Reference
- Variable Arguments
- ARRAY
- Basics
- Operations
- Create
- Search
- Modify
- Sort
- Storage
- STRING
- String Basics
- String Compare
- String Search
- String Replace
-
String Format
- String Regexp
- String Parse
- Formating
- Json
- STREAMS
- File Open
- Read File
- Read Csv
- File Contents
- Context
- Ob_start
- OOP
- Object Instantiation
- Class Constructor
- Interfaces, Abstract
- Resource Visibility
- Class Constants
- Namespaces
- HTTP
- Headers
- File Uploads
- Cookies
- Sessions
Character
ord() - Return ASCII value of character chr() - Return character by ASCII code
echo ord("A"); // 65
echo chr(65); // A
Number
number_format() - is not locale-aware, and returns a rounded number
echo number_format("100000.698"); // 100,001
echo number_format("100000.698", 3, ",", " "); // 100 000,698
Pad
str_pad() - Pad a string to a certain length with another string
echo str_pad("100", 6, "0"); // 100000
echo str_pad("333", 6, "0", STR_PAD_LEFT); // 000333
Last update: 570 days ago