Home

PHP Basics

Strings Functions

<?php $string = 'bac'; $stringParts = str_split($string); sort($stringParts); echo implode('', $stringParts);

Regex Replacement on Strings

<?php $string = "T34okyo!"; $replacement = ""; $pattern = "/[^a-z]/i"; echo preg_replace($pattern, $replacement, $string);

Repository

https://github.com/okeeffed/developer-notes-nextjs/content/php/php-basics

Sections


Related