line break for option in select box
Posted on 2004-11-15
I need to populate a select box with the results of a query. The values of the query are long so what i need to do is insert a line break so that the select box doesnt cause a horizontal wrap on the webpage. this has been done before in CF by doing the following;
selecting a predefined point that would relate to how many characters could fit into the select box and not cause a horizontal wrap
if the particular value is longer than the predefined point (aka number of values) then continue;
starting at that point and going backwards, looking for " " in the string value
when the space (" ") is found, enter a line break.
what is the code to do this in php?