Re: parse error
| From: | Joe Stump | Date: | Mon, 09 Apr 2001 00:14:12 +0000 |
| Subject: | Re: parse error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47689@lists.php.net to get a copy of this message | ||
Worked for me, but I had to make sure that $messagearray was in fact an array.
So wrap that block of code in this:
if(is_array($messagearray) && sizeof($messagearray))
{
}
--Joe
On Mon, Apr 09, 2001 at 01:13:00AM +0100, kenny.hibs wrote:
> I am getting a parse error in the following line of code
>
> **************************
> foreach ($messagearray as $value) {
> //print("strlen: " . strlen($value));
> if (strlen($value) >= 22) {
> ?>
> <script>
> alert('Your post is too long...use the forum for longer stories.')
> </script>
>
> <?
> $message="";
> break;
> }
> }
> *************************
> can anyone see whats causing the problem
>
> kenny
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
/******************************************************************************\
* Joe Stump - PHP/SQL/HTML Developer *
* http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net *
* "Better to double your money on mediocrity than lose it all on a dream." *
\******************************************************************************/