3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = '<p align="center"><font face="Proxima Nova Alt Th" size="21" color="#ffffff" letterSpacing="-1.000000" kerning="1"><b>YOUR</b></font></p><p align="center"><font face="Proxima Nova Alt Th" size="21" color="#ffffff" letterSpacing="-1.000000" kerning="1"><b>OFFER</b></font></p>'; $regex = "/font face=\"([a-z 0-9]+)\"/i"; $font = preg_replace_callback($regex, function($matches) { return $matches[1]; // I WANT TO GET THE FONT HERE, INSTEAD, ON VAR_DUMP, I GET FORMATTED TEXT (I literally only want the text) }, $string); var_dump($font);
Output for 5.3.0 - 7.1.0
string(251) "<p align="center"><Proxima Nova Alt Th size="21" color="#ffffff" letterSpacing="-1.000000" kerning="1"><b>YOUR</b></font></p><p align="center"><Proxima Nova Alt Th size="21" color="#ffffff" letterSpacing="-1.000000" kerning="1"><b>OFFER</b></font></p>"
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/t8o65 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/t8o65 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/t8o65 on line 6
Process exited with code 255.