Quote:
Originally Posted by curtiss
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.