2

I have a PHP file, I needed to get the HTML code only for send email. where I use file_get_contents(email.php); it also get the php code is there are any way i can get only HTML out?

<?php 
   $pid=20;
   $cid=30;
?>

<!DOCTYPE html>
<html>
    <head>
        <title>Promotion Email</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
  <p><?php $pid + $cid ?></p>
</body>

I need only HTML I tried to get like this:

$body = file_get_contents("promotion-mail-contents.php");
0

1 Answer 1

3

Yes, just call it like from external.

$body = file_get_contents("http://www.yourdomain.com/promotion-mail-contents.php");

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.