ı want to add following code between < div >here < /div > tags
for example:
$ad_code = '<div>include 'ban.php'; </div>';
but it doesn't work how can I do this
ı want to add following code between < div >here < /div > tags
for example:
$ad_code = '<div>include 'ban.php'; </div>';
but it doesn't work how can I do this
<div>
<?php include ban.php; ?>
</div>
It's really incredibly easy, and I can't believe Google could not have solved your problem here.
This is on the presumption you're putting this straight onto the page. It's hard to answer really as you've given us almost nothing to go on.
Following a little more info, this is a possible duplicate of; require/include into variable
Let me assume ban.php
<?php
echo '<div>Banner</div>';
?>
and on your php file.
<?php
ob_start();
include('./ban.php');
$ad_code = ob_get_clean();
echo $ad_code;
?>
I think this is what you want, if i had understood your question correctly.
or try this
<?php
$ad_code = file_get_contents('./ban.php');
?>