3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $kalimat_dasar = "maaf, saya tiba-tiba harus pulang."; // handle tanda baca = ',','.','!','?' $tanda_baca = '/[,\.]/'; $pemisah = '#$1'; $kalimat_lv1 = preg_replace(tanda_baca , $pemisah , $kalimat_dasar); print_r($kalimat_lv1);
based on 0ARLm
Output for 7.2.0
Warning: Use of undefined constant tanda_baca - assumed 'tanda_baca' (this will throw an Error in a future version of PHP) in /in/h6caK on line 8 Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /in/h6caK on line 8
Output for 5.3.21 - 7.1.10
Notice: Use of undefined constant tanda_baca - assumed 'tanda_baca' in /in/h6caK on line 8 Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /in/h6caK on line 8