nl2br() question

nl2br() question

am 26.09.2009 17:22:48 von TedD

Hi gang:

The manual says:

http://www.php.net/nl2br

That I could use the function like so (Example #2):

$new = nl2br($string, false);

But when I do, I get:

Warning: Wrong parameter count for nl2br() in /home...

What's up with that?

I am using PHP Version 5.2.10

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: nl2br() question

am 26.09.2009 17:27:26 von Ashley Sheridan

On Sat, 2009-09-26 at 11:22 -0400, tedd wrote:
> Hi gang:
>
> The manual says:
>
> http://www.php.net/nl2br
>
> That I could use the function like so (Example #2):
>
> $new = nl2br($string, false);
>
> But when I do, I get:
>
> Warning: Wrong parameter count for nl2br() in /home...
>
> What's up with that?
>
> I am using PHP Version 5.2.10
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>

The second parameter was only added in PHP 5.3.0, so I presume your PHP
version is before that.

Thanks,
Ash
http://www.ashleysheridan.co.uk




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: nl2br() question

am 26.09.2009 17:27:32 von Daniel Brown

On Sat, Sep 26, 2009 at 11:22, tedd wrote:
> Hi gang:
>
> The manual says:
>
> =A0 http://www.php.net/nl2br
>
> That I could use the function like so (Example #2):
>
> =A0 $new =3D nl2br($string, false);
>
> But when I do, I get:
>
> =A0 Warning: Wrong parameter count for nl2br() in /home...
>
> What's up with that?

Read the manual fully, Teddence. Check the Changelog info, specificall=
y.

> I am using PHP Version 5.2.10

.... whereas the `is_xhtml` parameter was added in 5.3.0. And
5.3.0 > 5.2.10. ;-P

--=20

daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: nl2br() question

am 26.09.2009 17:42:37 von HallMarc Websites

Tedd,



> -----Original Message-----
> From: tedd [mailto:tedd@sperling.com]
> Sent: Saturday, September 26, 2009 11:23 AM
> To: PHP General List
> Subject: [PHP] nl2br() question
>
> Hi gang:
>
> The manual says:
>
> http://www.php.net/nl2br
>
> That I could use the function like so (Example #2):
>
> $new = nl2br($string, false);
>
> But when I do, I get:
>
> Warning: Wrong parameter count for nl2br() in /home...
>
> What's up with that?
>
> I am using PHP Version 5.2.10
>
> Cheers,
>
> tedd
>

It seems to me that it doesn't think it is being passed a string. Have you
tried putting in a static test string like

$new = nl2br("Hello/n World!", false);
echo $new;
or alternatively
echo $string;

and see what is being passed.


Thank you,
Marc Hall
HallMarc Websites
610.446.3346


__________ Information from ESET Smart Security, version of virus signature
database 4459 (20090926) __________

The message was checked by ESET Smart Security.

http://www.eset.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: nl2br() question

am 26.09.2009 17:57:47 von TedD

At 11:27 AM -0400 9/26/09, Daniel Brown wrote:
>On Sat, Sep 26, 2009 at 11:22, tedd wrote:
>
>> I am using PHP Version 5.2.10
>
> .... whereas the `is_xhtml` parameter was added in 5.3.0. And
>5.3.0 > 5.2.10. ;-P
>
>--
>


Ahhh, I didn't look far enough down the page.

Thanks -- I figured out a solution anyway.

Cheers,

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: nl2br() question

am 26.09.2009 18:30:53 von Carl Furst

That option was added in 5.3.0 So you have to upgrade for that to work.

tedd wrote:
>

Hi gang:
>
> The manual says:
>
> http://www.php.net/nl2br
>
> That I could use the function like so (Example #2):
>
> $new = nl2br($string, false);
>
> But when I do, I get:
>
> Warning: Wrong parameter count for nl2br() in /home...
>
> What's up with that?
>
> I am using PHP Version 5.2.10
>
> Cheers,
>
> tedd
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php