echo $file_contents;
На выходе так:
строка 1 - пустая строка
строка 2 - key 1, key 2, key 3, key 4, key 5
Example
1 - тут пустая строка
key 1, key 2, key 3, key 4, key 5
Как преобразовать строку в такой вид:
<li>key 1</li>
<li>key 2</li>
<li>key 3</li>
<li>key 4</li>
<li>key 5</li>
Также нужно убрать первую, пустую строку. ((
Обновление
curl_setopt ($ch, CURLOPT_URL, 'http://test.com/?key='.$keys2); //Просто пример
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
$file_contents = strip_tags($file_contents);
$file_contents = str_replace('["'.$keys2.'",[','',$file_contents);
$file_contents = str_replace(']]','',$file_contents);
$file_contents = str_replace('"','',$file_contents);
$file_contents = str_replace('['.$keys2.',','',$file_contents);
$file_contents = str_replace('[','',$file_contents);
echo $file_contents;