View Full Version : adding word wrap to a spliti array??
- |Flash Man| -
June 21st, 2007, 08:01 PM
Hey all,
I have 20 words each split using "spliti" and I need to add word wrap to this or a line width so it will wrap to the next line...as it does not wrap currently.
Any ideas how to do this?
Here is some code that I have:
$chunks = spliti (",", $string, 20);
Thanks in advance
joran420
June 21st, 2007, 08:31 PM
huh?
you can enter
'<br />' or '\n' to force a linebreak
but to make a wordwrap textField in flash
myTextField.multiLine = true
myTextField.wordWrap= true
should work
eirche
June 21st, 2007, 08:47 PM
there is a wordwrap() function in php
- |Flash Man| -
June 21st, 2007, 08:49 PM
i'm not using flash....
Pretty much what i am doing is capturing data from a website which is generated from a database...i am storing this in a cookie and creating a pdf dynamically using php where the cookie (my data) is entered into a table and split into 20 cells. 1 word per cell....
My problem is that some of the words are really long and are going past my cell boundaries without wrapping...I need to add a word wrap or something to keep the words within the cell...
I have a previous post in this forum that has the class and everything that creates the pdf and the table.
Cheers :)
joran420
June 21st, 2007, 09:10 PM
ahhh I got confused because your posting in flash 8 instead of server languages :P
naw dunno then sorry :P
[edit] or im a retard and im in serverside languages not flash 8 :P
- |Flash Man| -
June 21st, 2007, 10:12 PM
LOL No probs :P happens to the best of us lol
simplistik
June 21st, 2007, 11:11 PM
The best thing for you to do would be to truncate each sentence by a letter count then. Take the average width of the letters to determine a decent amount of characters you want to allow on one line. Though this can get skewed because capital letters take up more space than lowercase.
- |Flash Man| -
June 21st, 2007, 11:47 PM
i have actually done it with the wordwrap function and that works fine...but my only problem (from the previous thread i posted not soo long ago...my last thread i think) is that i am creating a pdf from php and the table that the class creates does not support word wrap...if i could get that working that would be great! but i don't know where to start as the class is not mine.
Maybe nokrev aswell can shed some light (he is usually good with this sort of stuff) :D
Here is the URL to the other thread:
http://www.kirupa.com/forum/showthread.php?t=265181
simplistik
June 22nd, 2007, 08:55 AM
there is a wordwrap() function in php
Well whaddaknow... nice man :D
http://us2.php.net/wordwrap
- |Flash Man| -
June 22nd, 2007, 11:52 AM
I still gotta try a few things but hopefully it will all work soon...i really wanna try and get that wordwrap happening in the class for the "cells of the table the class creates"
Cheers :D
eirche
June 22nd, 2007, 09:16 PM
it looks like you really need help. why don't you post your code (again), and tell us what you need to be done? i will spend some time to look into it. and what version of php?
michellebarkley
June 29th, 2007, 02:10 AM
there is a wordwrap() function in php
u use this function to word wrap
Accounting Outsourcing (http://www.ifrworld.com) and Bookkeeping outsourcing (http://www.ifrworld.com/bookkeeping-outsourcing-online.html)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.