Failure in script

Hello,

Excuse my English, I am Dutch.

I have a problem in a php script.
It says:

WARN

in_array() expects parameter 2 to be array, null given

File: /home/wilvaxu8/domains/denarcist.nl/public_html/forum/sachat/functions.php
Line: 1014

INFO

Undefined index: permissions

File: /home/wilvaxu8/domains/denarcist.nl/public_html/forum/sachat/functions.php
Line: 1014

[php]1014- if (!is_array($permission) && in_array($permission, $user_settings[‘permissions’])) [/php]

What is wrong? or what does line 1014 mean?

I am a dummy in php, sorry!
Thanks!

With kind regards,
Wil

From the looks of it, you are not getting any value for $user_settings[‘permissions’]

in_array() expects parameter 2 to be array, null given

Your second parameter ($user_settings[‘permissions’]) is null
$user_settings[‘permissions’] should be an array

This is from http://php.net/manual/en/function.in-array.php
[php]bool in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] )[/php]

run the following to see that that value in the array is null.
[php]var_dump($user_settings[‘permissions’]);[/php]

then try this to see if the $user_settings is even set…
[php]var_dump($user_settings); [/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service