Skip to content

Instantly share code, notes, and snippets.

@andymagill
Created October 11, 2018 02:17
Show Gist options
  • Save andymagill/60ef259986fff30e71bb7633d763246e to your computer and use it in GitHub Desktop.
Save andymagill/60ef259986fff30e71bb7633d763246e to your computer and use it in GitHub Desktop.
Why does this return empty string ?
$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