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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...