Does the location of the server hosting a website impact its search engine ranking?

The location of the server hosting a website can impact its search engine ranking, especially for local search results. To improve search engine ranking, consider hosting the website on a server located in the same region or country as the target audience. This can help improve website loading speed and overall user experience, which are factors that search engines take into consideration when ranking websites.

// Example code to set the server location in PHP
// Set the server location to a specific country
header('Content-Language: en-US');