3v4l.org

run code in 300+ PHP versions simultaneously
<?php $replaces = [ '#3d#' => '3D', '#\bmax\b#' => 'MAX', //меняем только вхождения в целых словах, слово max заменится на MAX, в слове maximum max не поднимется. '#program#is' => 'PROGRAM' //меняем любые вхождения: program, Program, PROgram и тд... получим PROGRAM ]; function replacer($params, $string) { $from = array_keys($params); $to = array_values($params); return preg_replace( $from, $to, $string); } $TheTitle = 'maximum best program for you - this is a 3d max - super puper pRoGrAm'; $titleNew = replacer($replaces, $TheTitle); var_dump($titleNew); //string(70) "maximum best PROGRAM for you - this is a 3D MAX - super puper PROGRAM"
Output for git.master, git.master_jit, rfc.property-hooks
string(70) "maximum best PROGRAM for you - this is a 3D MAX - super puper PROGRAM"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
113.77 ms | 405 KiB | 5 Q