Jump to content

brane

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

brane's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I mean that the program will read the string, split the characters into the $array,  find the size of the array, echo the size of the array, depending on the size of the array it will also echo which case it will execute as i am using a switch to diffferentiate between 5 6 and 7 letter strings, but after that for a seven letter string it will not do anything else.  It works for 5 and six letters when it prints the ending array with a line break.  I wouldn't think that the results would take up a gig of ram, but again I am pretty much a noob.  Thanks for your input :) sorry i forgot to mention that each output will also be 7 characters long so I think that it should return 5040 results.
  2. Hi,   I am a bit new to php and have only written a few programs with it.  The current one I am working on will find all the permutations of a string and match them against a word list in sql , so I do not feel guilty cheating on the jumble games in the newspaper.  I have been able to find the permutations of up to six letter strings by doing: foreach($array as $a )   foreach($array as $b )     foreach($array as $c )       foreach($array as $d )         foreach($array as $e )           foreach($array as $f )             $end_arr[]= $a. $b. $c. $d. $e. $f. ; My problem is that as soon as i add another line for the seventh character in the array to be handled as $g the program will not work.  Is there a limitation as to how many nested foreach functions you can use? I am using PHP 5.0.4 on a 64 bit version of Suse 10.  Also when the program goes to compile it does not show the error and line number if it fails.  Is there a line I need to edit in the ini to turn on the debugging feature?  This feature used to help me out a lot in PHP 4 but i have since upgraded.  Also if anyone knows a better way to find the permutations of a string any help would be appreciated.  Thanks in advance :)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.