3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "resource_id_heeelp_lala_klopsiki"; preg_match_all('/(_[\w]{1})/', $string, $matches); if(!empty($matches[0])){ foreach($matches[0] as $key){ $result = substr($key, 1, 1); //result is c print $key.' '.ucfirst($result).'<br />'; //$result1=str_replace($result,'',$key);//now your result1 is apitalize //$result2=ucfirst($result1); //now result2 is Apitalize //$finalresult=$result.$result2; ///now your finalresult is cApitalize $string = preg_replace("/_i/", ucfirst($result), $string); } } print $string;
Output for git.master, git.master_jit, rfc.property-hooks
_i I<br />_h H<br />_l L<br />_k K<br />resourceId_heeelp_lala_klopsiki

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:
38.32 ms | 401 KiB | 8 Q