On Tuesday 25 March 2008, Albert Cuesta wrote:
Hi
Our hosting provider upgraded PHP4 to PHP5, and now some parts of our Drupal 5.x site have stopped working.
This is what we are getting when trying to access many pages:
Fatal error: Cannot use string offset as an array in /home/MYSITE/public_html/sites/all/themes/MYSITE/template.php on line 51
Any suggestions for fixing this?
Thank you!
There are several array handling functions that are supposed to take an array and an array. In PHP 4, you could be lazy and pass a string as the second parameter and PHP would silently convert it to a one-element array for you. PHP 5 requires you to pass a for-reals array as the second parameter. It sounds like that is what you're running into.
Check to see what's on line 51, and see the PHP manual for any functions youre using. If that's not it, then as others have said "show us the code!" :-)