As the title says I have an array with all the domains of my site for different countries. What I want is to loop this array and echo it to browser but I don't want to include the current domain to the list.
Example: domains = ['test1.com', 'test2.pl','test3.it','test4.uk','test5.de']
I want my foreach loop print all the above domains except the one that the user currently visits, so if you visit test1.com page, all the other pages should be listed. I'm using a php framework but probably it's irrelevant.
This is my current code:
@foreach(sites as $site)
<a class="" href="http://{{ $site }}">{{ $site }}</a>
@endforeach
Try feeding $site through parse_url. You can than extract the hostname and match it against the currently requested hostname (via the $_SERVER variable)