Dunebook / codesource

0 stars 0 forks source link

how-to-get-domain-name-from-url-in-php/ #21

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

How to Get Domain Name From URL in PHP

In this article, you will learn how to get domain name from a URL in PHP. Let’s say you have a string variable named ‘a’ that has the value of

https://codesource.io/how-to-get-domain-name-from-url-in-php/

bauinformatiker commented 2 years ago

Why is

$a = 'https://codesource.io/javascript-design-patterns/';

wrong?

Parse error: syntax error, unexpected 'https' (T_STRING) in ..\test.php on line 1