display string variable in web browser ( n characters per line) Is it possible in php to display in web browser string variable with specified number of characters per line. For example variable s="44444444" Is it possible to displays s in web browser with 2 characters per line? Like this: 44 44 44 44 If you know how to do this, could you give exact code.
Use http://uk2.php.net/substr to break the string into 2 character sections and then echo each section on a new line. Or use a function to insert /n or <BR> every 3rd character.
http://se.php.net/manual/en/function.wordwrap.php Use this function to wrap a string into lines with a specified number of characters then use the nl2br function to insert <br>'s.