Extract domain from permalink
-
I´m some kind of a noob concerning php and maybe my problem is more than simple.
I try to extract the domain from a permalink. If you have “www.test.com/test.html” it should write http://www.test.com. I´d like to put this under my posts.
Till know I tried the following piece of code inside my single.php, but nothing appears:
<?php $url = ‘<?php the_permalink() ?>’;
$parse = parse_url($url);
print $parse[‘host’];
?>Is anyone out there to help me? Any help would be really appreciated.
Thank you, friends!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Extract domain from permalink’ is closed to new replies.