[Solved] Undefined fuction in_array()

Problems with the Linux version of XAMPP, questions, comments, and anything related.

[Solved] Undefined fuction in_array()

Postby Saphir » 09. August 2012 20:36

Hi everyone.

I've just installed xampp on my 12.04LTS, and everything seems to work fine.

But today i've tried to create a little function which checks if there's a particular word in an array generated with str_word_count().

The problem now:
Fatal error: Call to undefined function in_array() in /opt/lampp/htdocs/arya/index.php on line 100


I thought in_array() was a buit-in function though. The strange thing is that it indicates me that the problem is on line 100, though the block starting at this line is:
Code: Select all
if(in_array("CALENDAR", $word)) {
   $wordu[$nbwu] = "calendar";
   $nbwu++;
}

although the previous block (starting on line 96) is:
Code: Select all
if(in_array("DRIVE", $word)) {
   $wordu[$nbwu] = "drive";
   $nbwu++;
}


It seems that the problem always come from the first occurrence of in_array() after the line 100 (if I comment out the line 100 block, it indicates me 104, then 108, etc.

Anybody can help?
Thank by advance, and sorry for my bad English.
Last edited by Saphir on 10. August 2012 23:45, edited 1 time in total.
Saphir
 
Posts: 2
Joined: 09. August 2012 20:26
Operating System: Ubuntu 12.04 LTS

Re: Undefined fuction in_array()

Postby JonB » 10. August 2012 18:09

I think you have 'hidden characters' in your code.

I discovered this by pasting your second code example into a programmer's editor.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Undefined fuction in_array()

Postby Saphir » 10. August 2012 23:44

You were right, emacs was able to show me some things like underscores between || and in_array(), while gedit wasn't.
Thanks for your reply. :)
Saphir
 
Posts: 2
Joined: 09. August 2012 20:26
Operating System: Ubuntu 12.04 LTS


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 68 guests