Title: PHP error
Last modified: August 20, 2016

---

# PHP error

 *  [djeyewater](https://wordpress.org/support/users/djeyewater/)
 * (@djeyewater)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/php-error-30/)
 * Hi
 * I got this notice in my error logs:
    `PHP Notice: Undefined variable: array2 
   in /wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.
   php on line 127` To fix, Ln 104 add: `$array2=array();`
 * [http://wordpress.org/extend/plugins/ultimate-category-excluder/](http://wordpress.org/extend/plugins/ultimate-category-excluder/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael Clark](https://wordpress.org/support/users/planetmike/)
 * (@planetmike)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/php-error-30/#post-3356038)
 * Hi, thanks for that bug report. I’m looking into it, trying to reproduce it. 
   What version of WP, PHP, MySQL are you using? You can email me directly if you
   don’t want to post that info publicly. Mike
 *  Thread Starter [djeyewater](https://wordpress.org/support/users/djeyewater/)
 * (@djeyewater)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/php-error-30/#post-3356085)
 * Hi Mike
 * You can see the error if you have error reporting turned on. in my wp-config.
   php I have:
 *     ```
       define('WP_DEBUG', true);
       define('WP_DEBUG_LOG', true);
       define('WP_DEBUG_DISPLAY', false);
       ini_set('display_errors',0);
       ```
   
 * (I’m actually trying to debug a problem with wp-cron not working, but it is difficult
   when the error logs are full of errors from unrelated things).
 * If you look at the function `ksuce_exclude_categories` (line 102 in ultimate-
   category-excluder.php) you’ll see that you’re trying to add an item to the array
   $array2.
    `$array2[$mbccount] = $value;` But $array2 is not declared in the function,
   so PHP throws this Notice. It is a notice, not a critical error.
 * It can be fixed by declaring $array2 as an array at the start of the function(
   the fix I put in my previous post).
 * Cheers
 * Dave

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP error’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-category-excluder/assets/icon-256x256.png?rev=1352232)
 * [Ultimate Category Excluder](https://wordpress.org/plugins/ultimate-category-excluder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-category-excluder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-category-excluder/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-category-excluder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-category-excluder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-category-excluder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [djeyewater](https://wordpress.org/support/users/djeyewater/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/php-error-30/#post-3356085)
 * Status: not resolved