Skip to content

Instantly share code, notes, and snippets.

@andymagill
Created October 11, 2018 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andymagill/36ba1183cfb20ed188d88c5aee7dfd45 to your computer and use it in GitHub Desktop.
Save andymagill/36ba1183cfb20ed188d88c5aee7dfd45 to your computer and use it in GitHub Desktop.
Why does $message return as empty string ?
<?php
$message = file_get_contents(__DIR__ . '/confirmation.html');
$replace = array(
'[site_url]' => get_site_url() . '/wp-content/themes/artists-working/img/email/',
'[email]' => $email,
'[event_id]' => $event_id,
'[address]' => $event_address
);
foreach ($replace as $placeholder => $info) {
$message = str_replace($placeholder, $message, $info);
}
echo var_dump($message); // returns "" ?!?!
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment