tags:

views:

16

answers:

1

I'm trying to figure out how I can put text including line-break from a textarea on an image generated using GD2 library. I tried \n and
, nothing...

It's a stupid question but I can't find this information on the web.

Thanks!

A: 

GD doesn't support text formatting of that sort. You'll have to manually break the string into multiple lines,and place each one seperately.

Marc B
With input field? :S LOL old technology.. :) Thanks :)
Jeremy Dicaire
That, or process the textbox data server-side and split/explode the string based on line breaks.
Marc B
Ok thank you Marc... How I explode() line break? explode ("\n","$var")?
Jeremy Dicaire
Since there might be \r as well as \n line breaks in the text, you'd be better off with `preg_split("/[\r\n]+/", $var)` instead.
Marc B