I was wondering if it was possible too grab variables from a specified url stored in a mysql table named users and the field name being stat?
stat containing the url of course?
and then i want too grab data from that page :P
Printable View
I was wondering if it was possible too grab variables from a specified url stored in a mysql table named users and the field name being stat?
stat containing the url of course?
and then i want too grab data from that page :P
only way i no to grab data from a url is using the $_GET superglobal
Do you mean variables from a query string? Yes, it is possible, you can make an array in the same format asthe $_GET super global:
PHP Code:function get_querystring_vars($url)
{
$ret_array = Array();
$url = parse_url($url);
if ($url['query']) {
$var_array = explode('&', $url['query']); // you may need to replace & with & here
foreach($var_array as $var_pair) {
if (($pos = strpos($var_pair, '=')) !== false) {
$ret_array[substr($var_pair, 0, $pos)] = substr($var_pair, $pos + 1);
}
}
}
return $ret_array;
}
never knew that
You can do anything with PHP :D
can it make my bed and do my chores?