简体   繁体   中英

Remove HTML code and output in PHP destination url

I wanted to pull out html code Target URL and forgive with a variable

<a href="https://www.test.de/adtrack/3a10056f3.html" target="_blank"><img src="https://www.test.de/adtrack/3a10056f3.img" border="0" /></a>

$url = https://www.test.de/adtrack/3a10056f3.html

the $url wants to echo that too in php

Just echo the whole thing with your variable added in it.

$url = 'https://www.test.de/adtrack/3a10056f3.html'
echo '<a href="'.$url.'" target="_blank"><img src="https://www.test.de/adtrack/3a10056f3.img" border="0" /></a>';

or, echo it inside your html like this:

<a href="<?php echo $url; ?>" target="_blank"><img src="https://www.test.de/adtrack/3a10056f3.img" border="0" /></a>

If you do as above, remember that your file extension should be ".php" and not ".html" or else it won't work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM