FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP wirdwrap()
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
PHP wirdwrap() [message #182739] Sun, 01 September 2013 16:30 Go to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
Hi all,

I'm looking for verification (or the opposite) of the following things
about the PHP wordwrap() function:

This code works first time, every time:

<code>
$comments = $_POST["comments"];
echo $comments . "<br /><br />";
echo wordwrap($comments,40,"<br>");
</quote>

but this code always fails to do anything to the variable: it remains
exactly as the raw data was:

<code>
$comments = $_POST["comments"];
echo $comments . "<br /><br />";
$comments = wordwrap($comments,40,"<br>");
echo $comments . "<br /><br />";
</quote>

The display from both echo statements are identical in the above script;
no wrap and no errors, notices or warnings.

The manual, W3schools, et al all show examples that only use the "echo"
statement with it as in the first code snippet above. At first I assumed
because that was the best way to demo it, and nothing indicated the
wordwrap output couldn't be assigned to a variable. But since it won't
work any other way, well ... wassup up doc? :) What have I missed?

Also, at one time, I knew of a site where one could insert code snippets
of PHP and have them evaluated, but cannot locate it again; anyone
happen to know of one like that?

TIA,

Twayne`
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Android app Developers requirements
Next Topic: calling a value into another php script...
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 16:49:24 GMT 2024

Total time taken to generate the page: 0.04882 seconds