Topic: Arrays and in_array
Just wanting to check on what I'm missing here. Everything works as expected, but I'm getting this php warning:
PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument
The relevant parts that it refers to are:
the array:
$clock_array = array();
$clock_array[] = $pun_config['o_base_url'].'/forums.php';
$clock_array[] = $pun_config['o_base_url'].'/index.php';
the in_array check and variables:
$domain = $_SERVER['SERVER_NAME'];
$script_path = $_SERVER['SCRIPT_NAME'];
$page = 'http://'.$domain.$script_path;
if (@in_array($page, $clock_array)) {
I've put the @ in to suppress the warnings temporarily, but I'd prefer to get it working correctly if possible. I haven't been able to find any relevant info on the php docs site.
Cheers,
Matt