Jump to content


Photo

Newbie parse error


  • Please log in to reply
3 replies to this topic

#1 symplox

symplox
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 July 2006 - 08:44 AM

I finally got my LAMP sever configure the way I want and began writing my first php script, supposed to, in the long run, supposed to generate the list of all possible permutations of an anygram and send them thru pspell looking for real words.

Well, the following code gets a parse error
Parse error: syntax error, unexpected T_CONTINUE in /usr/local/apache/htdocs/unjumble.php on line 17
<?php
$holder = "";
$indx = 0;
$arry = NULL;

class x
{
   function __construct($jmbl,$str,$index,$array)
   {
      $this->str = $str;
      $this->index = $index;
      for($c = 0; $c < strlen($jmbl); $c++)
      {
         if(!isset($array))
            $array[$this->index] = $c;
         else 
            if(in_array($c, $array)
               continue;
            else
               array[$this->index] = $c;   
         $this->str = $this->str . $jmbl{$c};
         if(strlen($this->str) == strlen($jmbl))
            print $this->str . "<br />";
         else (new x($jmbl,$this->str,++($this->index),$array)); 
      }    
}
new x($__REQUEST['jumble'],$holder,$indx,$arry);
?>

There is some simple syntactic error but I am too much a php newbie to spot it, please help

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 18 July 2006 - 08:49 AM

Line 17 is:
if(in_array($c, $array)


Should be:
if(in_array($c, $array))

One to close the in_array(), one to close the if.

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 symplox

symplox
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 July 2006 - 08:54 AM

:P Boy, I swear I looked at that, I feel ,  :P

#4 symplox

symplox
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 July 2006 - 08:55 AM

Thank you!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users