Answers for "php get script name"

PHP
2

php get youtube code from url

<?php
$url = "http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate";
parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
echo $my_array_of_vars['v'];    
  // Output: C4kxS1ksqtw
?>
Posted by: Guest on April-29-2020
5

php get domain name from url

parse_url('http://www.website.com/hey.php', PHP_URL_HOST);
Posted by: Guest on January-24-2020
3

php current file name

basename(__FILE__, '.php');
Posted by: Guest on March-06-2020

Browse Popular Code Answers by Language