3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<TEXT Order is purchased on 23-05-2023.Order is in progress and you can see order status on website by enter id JKSZ089P6X07 012 TEXT; $orderId = "JKSZ089P6X07A07012"; $regex = '#\b' . substr_replace($orderId, '\s+', 12, 3) . '\b#'; var_export(preg_replace($regex, $orderId, $content));

preferences:
29.37 ms | 406 KiB | 5 Q