-1

I have this column

id |  subject  | message
1  |  register | Hello, welcome to $siteurl

I already get the colum by using php file and call the echo there

echo $email['subject'];
echo $email['message'];

The result will be like this

register Hello, welcome to $siteurl

before that I already put this code

<?php
$siteurl = 'domain.com';

after code in top

but the result still give me $siteurl instead of domain.com

can someone help me? how to show the string that I save in database into php page

Austin Leath
  • 85
  • 1
  • 1
  • 9
OperasiOps
  • 33
  • 7

1 Answers1

0

You need to replace that string first. E.g.,

$message = str_replace('$siteurl', $siteurl, $email['message']);

echo $message;

IMB
  • 15,163
  • 19
  • 82
  • 140