PHP String Functions
| Function | Description |
|---|---|
strlen($s) | Length |
strtoupper($s) | Uppercase |
strtolower($s) | Lowercase |
trim($s) | Remove whitespace |
str_replace($a,$b,$s) | Replace |
strpos($s,$find) | Position of substring |
substr($s,$start,$len) | Substring |
str_contains($s,$sub) | Contains? (PHP 8) |
explode($sep,$s) | String to array |
implode($sep,$arr) | Array to string |
sprintf($fmt,...) | Format string |