NYCPHP Meetup

NYPHP.org

[nycphp-talk] Anyone ever have any luck with get_browser?

Ian Forsyth ian at plusfour.org
Fri May 30 13:25:30 EDT 2003


On Friday, May 30, 2003, at 09:15  AM, soazine at pop.erols.com wrote:
>
>    // DETERMINE IF THE USER'S BROWSER HAS JAVASCRIPT BY REARRANGING THE
> get_browser() OBJECT AS AN ARRAY
>    $browser = get_browser();
>    foreach ($browser as $key => $val) {
>     $browserArray = array($key, $val);
>    }
>
>

this might work better..

foreach($browser as $key => $val){

	$browserArray[$key] = $val;
}

print_r($browserArray);

or just

if($browser->javascript == 1)
{
	include ("javascript_enabled_page");
}
else
	include("no_java_script");
}
Ian




More information about the talk mailing list