I made a function ajax where it creates such url:

http://darius.lt/lt/live_dogs/live_dogs_screen/echo_next_match_info?mac_list%5B%5D=00%3A1F%3AD0%3A6E%3A90%3AF4

But I need to creante same url without ajax. I mean i need to generate.

mac_list array is simply

array (
0: mac1,
1: mac2,...
)

when I use:

param = {mac_list: mac_list_global};

                $.getJSON(this.url, param, function(data) 

there is not problem, jquery creates it from the param object. But when I want to make mysefl, googled and tried few horus - and cannot make the same url :( how is this done?

I have a function that I use with PayPal that you could perhaps use/adapt.

function array2nvp($arr)
{
    $str = '';
    $delim = '';
    foreach ($arr as $key => $value) {
        $str .= $delim . $key . '=' . urlencode($value);
        $delim = '&';
    }
    return $str;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.