$keyword = 'iPhone & Galaxy/Note=100% #1';
$encoded = rawurlencode($keyword);

echo 'https://example.com/search?query=' . $encoded;
// 출력: 'https://example.com/search?query=iPhone%20%26%20Galaxy%2FNote%3D100%25%20%231'
rawurlencode(string $string): string
$server_url = 'https://www.example.com';
$image_path = '/images/my image.jpg';

// 파일 경로를 URL에 추가할 때 rawurlencode() 함수 사용
$encoded_image_path = rawurlencode($image_path);

$image_url = $server_url . $encoded_image_path;

echo $image_url;

// 출력: https://www.example.com%2Fimages%2Fmy%20image.jpg