// Assuming the current domain is https://example.com $url = getLocalUrl('/contact'); // Output: https://example.com/contact
// Assuming the current domain is https://example.com $url = getLocalUrl('/products', ['category' => 'electronics', 'page' => 2]); // Output: https://example.com/products?category=electronics&page=2
// Assuming the current domain is https://example.com $url = getLocalUrl('/login', [], true); // Output: https://example.com/login