Folks,
You know how to parse_url like so:
print_r()
[code]
<?php
$url1 = ‘https://localhost/Templates/Grab_Url.php?search=keyword&tbl=links&col=keyword&max=1&page=29’;
print_r(parse_url($url1)); echo ‘<br>’;
echo __LINE__; echo ‘<br>’; echo ‘<br>’;
?>
var_dump()
[code]
<?php
$url2 = ‘https://localhost/Templates/Grab_Url.php?search=keyword&tbl=links&col=keyword&max=1&page=29’;
var_dump(parse_url($url2)); echo ‘<br>’;
echo __LINE__; echo ‘<br>’; echo ‘<br>’;
?>
But have you tried parsing a link ? Such as this:
**<a href=”
Try and see what results you get!
These ain’t working for me:
print_r()
[code]
<?php
$link1 = ‘<a href=”https://localhost/Templates/Grab_Url.php?search=keyword&tbl=links&col=keyword&max=1&page=29″>Link1</a>’;
print_r(parse_url($link1)); echo ‘<br>’;
echo __LINE__; echo ‘<br>’; echo ‘<br>’;
?>
var_dump()
[code]
<?php
$link2 = ‘<a href=”https://localhost/Templates/Grab_Url.php?search=keyword&tbl=links&col=keyword&max=1&page=29″>Link2</a>’;
var_dump(parse_url($link2)); echo ‘<br>’;
echo __LINE__; echo ‘<br>’; echo ‘<br>’;
?>
**Using htmlentities():
print_r()
[code]
<?php
$link1 = ‘<a href=”https://localhost/Templates/Grab_Url.php?search=keyword&tbl=links&col=keyword&max=1&page=29″>Link1</a>’;
print_r(parse_url(htmlentities($link1))); echo ‘<br>’;
echo __LINE__; echo ‘<br>’; echo ‘<br>’;
?>
var_dump()
[code]
$link2 = ‘<a href=”https://localhost/Templates/Grab_Url.php?search=keyword&tbl=links&col=keyword&max=1&page=29″>Link2</a>’;
var_dump(parse_url(htmlentities($link2))); echo ‘<br>’;
echo __LINE__; echo ‘<br>’; echo ‘<br>’;
I see no parse_link() function in php. And so, let’s custom build one. I don;t know how to start so how about you make the first attempt ?
NOTE: I am trying to grab the url from the link and then parse the url.