wordwrap and fputs() funcion!!

06-16-2002, 08:40 AM
i have php 4.2.1 and next code won't wrap words :

$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap( $text, 20 );

echo "$newtext\n";

i wish too, if i can add text in text file with function fputs(), but to write at the top of file, not at the bottom

any help?

06-16-2002, 09:06 AM
I couldn't work with your first question but for your second:

You need to open the file in the append mode. Your code would
look like:
$fp = fopen("YourFilename","a");

06-16-2002, 02:32 PM
i want to wrap word if it's something like this

mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

becouse it is too large, and it wil enlarge my table (like word mm.... here)

and another, like append, i'm doing that, but i can add text only at the bottom, can't add on top of the existing text

06-16-2002, 02:35 PM
i tought, it's the same, but you see, i wrote mmmmmmm, without space, and i get mmmm in new line, youn now what i mean, if word is too long (600 characters), i wont word to wrap, so i can get 100 + new line + 100 + new line +....+100

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum