I’m trying to include my AdSense code inside a variable like this:
$ad = include_once('../adsense/ad.php');
echo $ad;
In ad.php I’m doing this:
<?php
return '<script>...</script>';
?>
It’s showing my AsSense ad but only once. After that, it’s outputting 1. Am I missing something here?
You called
include_once(), so the file will only be included one time. After that, it will returnTRUEbecause the call succeeded, but no new content was included. Use plaininclude()instead if you need to use it multiple times.