Hi,

How to draw image having 2-3 lines of text using gd library in php so that text should be mulitiline based on [enter] key hit and will be aligned and autowrap.

Now even when enter key is hit text is appearing on single line and is not autowrapped.

Any help will be appreciated.
Thanks in advance

When you draw text you have to tell the function the x and y positions. Build an array of strings by exploding on newlines then iterate over the array and modify the Y value based on the bounding box of the previous (see http://us3.php.net/manual/en/ref.image.php)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.