Title: PHP Error on Line 37
Last modified: August 20, 2016

---

# PHP Error on Line 37

 *  [lynxmarketing](https://wordpress.org/support/users/lynxmarketing/)
 * (@lynxmarketing)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/php-error-on-line-37/)
 * I am repeatedly getting the following PHP error logged on my WordPress site running
   IIS 7.5. Is there some tweak to code I need to make in order to prevent it in
   the future?
 * `PHP Warning: in_array() expects parameter 2 to be array, string given in C:\
   inetpub\wwwroot\wp-content\plugins\map-categories-to-pages\ListAllPagesFromCategory.
   php on line 37`
 * [http://wordpress.org/extend/plugins/map-categories-to-pages/](http://wordpress.org/extend/plugins/map-categories-to-pages/)

Viewing 1 replies (of 1 total)

 *  [Jason Wilson](https://wordpress.org/support/users/jjw303/)
 * (@jjw303)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/php-error-on-line-37/#post-3439463)
 * I’m not using exclusions so I just commented out the IF statement and closing
   bracket
 *     ```
       //if ( !in_array($category->cat_ID, $excludecat) ) {
       				$cats[]=$category->cat_ID;
       			//}
       ```
   
 * A better approach would likely be to change line 25
 * From:
    `$excludecat = empty($options['excludecat']) ? '' : explode(',', $options['
   excludecat']);`
 * To
 * `$excludecat = empty($options['excludecat']) ? array() : explode(',', $options['
   excludecat']);`
 * but I didn’t test it.

Viewing 1 replies (of 1 total)

The topic ‘PHP Error on Line 37’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/map-categories-to-pages.svg)
 * [Map Categories to Pages](https://wordpress.org/plugins/map-categories-to-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/map-categories-to-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/map-categories-to-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/map-categories-to-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/map-categories-to-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/map-categories-to-pages/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jason Wilson](https://wordpress.org/support/users/jjw303/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/php-error-on-line-37/#post-3439463)
 * Status: not resolved