Not sure if this is possible but what I am wanting to do is echo a html text link only if the page contains certain php code, in particular just the opening reference of ‘myApi’. So if the page contains the following code:
<?php myAPI(variables); ?>
Then I would like to include this somewhere else on the page
<?php echo '<a href="http://www.website.com/">Click Here</a>'; ?>
Any help would be much appreciated, thanks 🙂
Set an
ifsomewhere, and useissetto test if your API has set a specific variable or not.(The variable should be specific to your API, obviously.)
Update
I said “somewhere”, but it’s probably best to do the test logic it in a separate place than where you output the HTML. In that case, you’d need a flag for when you’re ready to spit out the HTML:
That way, when you re-visit the page later for revision or update, your logic not all mixed up with your display.