require_once('db_lib.php');
$oDB = new db;
$result = $oDB->select('select * from tweet_urls');
while ($row = mysqli_fetch_row($result)) {
//echo $row['1'].'</br>';
echo get_follow_url($row['1']);
}
function get_follow_url($url) {
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HEADER => false,
CURLOPT_NOBODY => true,
CURLOPT_FOLLOWLOCATION => true,
));
curl_exec($ch);
$follow_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
curl_close($ch);
return $follow_url;
}
I extract the tweets urls from twitter and I want to change the short urls into its original long urls. What is wrong in my code. I call the function get_follow_url($url) inside the while loop. I think I do some mistakes in calling array get_follow_url($row['1']) inside the call function .