This is a rather trivial problem...
I have a table with two fields, a text field for my article and a varchar field for the filename of the image.
When I retrieve my article, I place the whole article in one variable.
Before printing to screen, I normally use the nl2br($article) function so my text would be nicely displayed on the page.
I have no problems either retrieving the image.
My problem arises as I wish to place the image in the middle of the article where the text will wrap around a portion of the image.
My 1st approach was to
$articlelength = strlen($article)
$halfway = $articlelength/2;
initialize $counter
do {
display article["$counter"]; //one char
increment counter
if $counter = $halfway
print image
} $article is not fully printed
It does work however the spacing is awful.
I remembered that because I used the nl2br function, there are <BR> tags located within the article at specific locations.
That would mean if I inserted an image, the text won't wrap around smoothly since the inserted <BR> tags would dictate it to make a new line.
Any ideas ? I seem to be all out of them or just frustrated.