3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Subject: Update on Your Ticket: ID {{ random_number }} Body: Hello, Your ticket has been recently updated on {{ date }}. We kindly request you to review and acknowledge the changes made. If you have any further updates or queries regarding your ticket, please don't hesitate to respond to this email. Best Regards, {{ sender_name }}"; $parts = explode('Body:', $string); $subject = trim(str_replace('Subject:', '', $parts[0])); $body = trim($parts[1]); echo 'Subject = "'.$subject.'"'; echo PHP_EOL.PHP_EOL; echo 'Body = "'.$body.'"';
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
Subject = "Update on Your Ticket: ID {{ random_number }}" Body = "Hello, Your ticket has been recently updated on {{ date }}. We kindly request you to review and acknowledge the changes made. If you have any further updates or queries regarding your ticket, please don't hesitate to respond to this email. Best Regards, {{ sender_name }}"

preferences:
125.92 ms | 407 KiB | 5 Q