a href adds default URL with the given echo URL
Question
I am a little stuck in one situation. I am removing some errors from my site and got one unexpected error
here below is my code:-
<?PHP
$release_web_url = get_post_meta( get_the_ID(), '_links', true );
print_r($release_web_url) ; ?>
and the output of this code is:
Array ( [0] => Array ( [name] => Website [url] =>www.google.com ) )
I only want to echo the array URL value in the anchor HTML tag. So I did this coding below:
foreach($release_web_url as $item): ?>
<a href="<?php echo $item['url']; ?>">Website</a>
<?php endforeach;
now instead of getting anchor link = www.google.com | I got anchor link = 192.168.1.50/jobifylocal/www.google.com |
that thing doesn’t make any sense adding the other URL automatically in-front of the given URL.
0
plugin-development, plugins
2 years
2020-09-02T07:10:20-05:00
2020-09-02T07:10:20-05:00 0 Answers
50 views
0
Leave an answer