Forum Moderators: coopster

Message Too Old, No Replies

Need help with php coding

         

fsmobilez

9:05 am on Nov 12, 2008 (gmt 0)

10+ Year Member



Hi

i have two files in my site from one site u view 15 posts per page and when u click on the title for any page it will take u to another page from where u can read the complete post

on the page where are 15 posts are showing per page the post words dont get break while on other its ok

example is likt if the post is like this

hi,how r u, im fine, when will u meet me.

its coding is like this

<?=short_string($result_array[$i]['joke_text'], $joke_listing_show_characters, "...");?>

all the words on same line but when someone clicks to read the post on separte page the post will become like this

hi,
how r u,
im fine,
when will u meet me.
its coding is like this

<?=nl2br($select_joke_result['joke_text'])?><font color="#CC0000">

when im tring to add
nl2br
in this code its giving error, i tried many variations like
<?=nl2brshort_string($result_array[$i]['joke_text'], $joke_listing_show_characters, "...");?>

<?=nl2brshort_string nl2br($result_array[$i]['joke_text'], $joke_listing_show_characters, "...");?>

but all giving error will u plz add br in this coding

<?=short_string($result_array[$i]['joke_text'], $joke_listing_show_characters, "...");?>

I hope u understood what i want to say and u will help me resolving the issue

Thanks a bunch.

omoutop

11:39 am on Nov 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you use the nl2br() function wrong

you must use : nl2br($some_string_or_some_function_here)

In your example:

nl2br(short_string($result_array[$i]['joke_text'], $joke_listing_show_characters, "..."))

watch the bold parts

fsmobilez

12:03 pm on Nov 12, 2008 (gmt 0)

10+ Year Member



thanks a bunch problem resolved