View Single Post
  #3 (permalink)  
Old 07-31-2008, 12:02 PM
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 249
Quote:
Originally Posted by curtiss View Post
My first guess would be that $keyword is not really an array, but a string.

If you use a string in a scalar context (place a number in square brackets after the string name), it will use one letter from the string.

I do find it a bit strange that you're running the loop according to the count of a variable called "$bigWords", but you're utilizing a variable called $keyword inside.

Finally, unless your keyword will include a regexp at any point in time, you really should be using str_ireplace instead of preg_replace.
I realized when I pasted that section the $keyword wasn't mentioned before. And echo $strtext should be placed outside the for loop.
Reply With Quote