3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $templateBody = '<p>Dear [#applicant_name_forename],</p> <p>We have received your application for a criminal record check with [#company_name] and have processed your ID documents. These will be posted back to you today via Royal Mail. The tracking number for these items is [#docs_recorded_delivery_receipt] and you can view their return progress via the Royal Mail website:</p> <p>http://www.royalmail.com/trackdetails</p> <p>Tracking is available after 5pm today.</p> <p>For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages:</p> <p>http://www.ddc.uk.net/help-advice/dbs-checkfaqs/</p> <p>Regards</p> <p>DDC Countersignatory Team</p>'; $emailBody = 'Dear Morty, We have received your application for a criminal record check with Galatic Federation and have processed your ID documents. These will be posted back to you today via Courier Flap. The tracking number for these items is 123123123 and you can view their return progress via the Courier Flap website: http://www.courierflap.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team'; $templateBody = strip_tags($templateBody); $emailBody = strip_tags($emailBody); var_dump($templateBody); var_dump($emailBody); $templateBody = preg_replace('/^\s+/m', '', $templateBody); $emailBody = preg_replace('/^\s+/m', '', $emailBody); $templateBody = preg_replace( [ '/' . preg_quote('[#applicant_name_forename]') . '/', '/' . preg_quote('[#company_name]') . '/', '/' . preg_quote('[#docs_recorded_delivery_receipt]') . '/' ], 'TEMPORARYREPLACER', $templateBody ); $templateBody = preg_quote($templateBody, '/'); $templateBody = preg_replace('/TEMPORARYREPLACER/', '(.*)', $templateBody); preg_match('/' . $templateBody . '/', $emailBody, $matches); var_dump($matches);
based on FqFg7
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0alpha1
string(640) "Dear [#applicant_name_forename], We have received your application for a criminal record check with [#company_name] and have processed your ID documents. These will be posted back to you today via Royal Mail. The tracking number for these items is [#docs_recorded_delivery_receipt] and you can view their return progress via the Royal Mail website: http://www.royalmail.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team" string(611) "Dear Morty, We have received your application for a criminal record check with Galatic Federation and have processed your ID documents. These will be posted back to you today via Courier Flap. The tracking number for these items is 123123123 and you can view their return progress via the Courier Flap website: http://www.courierflap.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team" array(0) { }