if so, use code with more error handling like:
if (isset($irc->channel[strtolower($data->channel)]) {
foreach ($irc->channel[strtolower($data->channel)]->ops as $key => $value) {
and so on...
}
}
the strtolower is very important! the whole array is case sentive and all channels there are lower cased! (because of uniqueness)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
$oplist='';
foreach ($irc->channel[$data->channel]->ops as $key => $value) {
$oplist .= ' '.$key;
}
Also if you insert '#channel'..same error.
PHP Warning: Invalid argument supplied for foreach() in
C:\php\example.php on line 36
did you setChannelSync(true); ?
if so, use code with more error handling like:
if (isset($irc->channel[strtolower($data->channel)]) {
foreach ($irc->channel[strtolower($data->channel)]->ops as $key => $value) {
and so on...
}
}
the strtolower is very important! the whole array is case sentive and all channels there are lower cased! (because of uniqueness)