Jump to content

Recommended Posts

Posted

http://bybyron.net/test/get-file-ext-b.php

 

<?php
$url = "http://www.domain.tk/idvalue";
$extract = pathinfo($url);
$dname = ($extract['dirname']);
$file = ($extract['filename']);
$ext = ($extract['basename']);
echo "$dname<br>";
# echo "$file<br>";
echo "$ext";
?>

 

 

http://bybyron.net/test/get-url-parts-b.php

 

<?php
$url = "http://www.domain.tk/idvalue";
$url_parts = parse_url($url);
print_r($url_parts);

$scheme = ($url_parts['scheme']);
$host = ($url_parts['host']);
$path = ($url_parts['path']);

echo "<br><br>";
echo "Scheme: $scheme<br>";
echo "Host: $host<br>";
echo "Path: $path";
?>

 

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...