Skip to content

Instantly share code, notes, and snippets.

@locvfx
Last active March 21, 2020 15:42
Show Gist options
  • Save locvfx/b51dfa35e62a04f3d9e8535bf14e589d to your computer and use it in GitHub Desktop.
Save locvfx/b51dfa35e62a04f3d9e8535bf14e589d to your computer and use it in GitHub Desktop.
PHP - Usefull functions
ucfirst(strtolower($row['name']));
$loop = 10;
$end_id = $start_id + $loop ;
echo "<a href='/admin/developer/inventory/auto_update_shop_column/$end_id'>>>>>>>>>>>>>>>>>>>>> NEXT</a><br>";
for ($i=1; $i <= $loop ; $i++) {
$this->update_shop_column ($start_id);
$start_id++;
}
mb_convert_encoding($string, 'UTF-8', 'UTF-8');
$variable = substr($variable, 0, strpos($variable, "By"));
function getKeywordSuggestionsFromGoogle($keyword) {
$keywords = array();
$data = file_get_contents('http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl=en-US&q='.urlencode($keyword));
if (($data = json_decode($data, true)) !== null) {
$keywords = $data[1];
}
return $keywords;
}
var_dump(getKeywordSuggestionsFromGoogle('money'));
error_reporting(E_ALL & ~E_NOTICE & ~ E_WARNING);
ini_set('display_errors', 1);
function url_get_contents ($Url) {
if (!function_exists('curl_init')){
die('CURL is not installed!');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment