Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-19-2012, 10:23 PM   PM User | #1
Trki
Regular Coder

 
Join Date: Jan 2012
Location: Slovakia
Posts: 108
Thanks: 9
Thanked 0 Times in 0 Posts
Trki is an unknown quantity at this point
Function string to hyperlink problem

Hi i have some function to convert spaces to one space or 3 break lines to just one break line but i am having trouble with this: i found it in database and it does problem for me ...

http://someurl/400-za-ucasti-svetovy...<br /> stream pro dlouhé večery

THIS SYMBOL I CANT PUT HERE BECAUSE IT DELETE IT so here it is with spaces: & # 1 0 ;

AND WHAT I WANT TO DO ... IS DELETE THIS...
what means line break created with shift + enter... any ideas please? :P Or i can delete them before inserting to database or whatever i just want to know how to solve this problem with shift + enter line :P THX

Last edited by Trki; 10-19-2012 at 10:36 PM..
Trki is offline   Reply With Quote
Old 10-20-2012, 08:32 PM   PM User | #2
Trki
Regular Coder

 
Join Date: Jan 2012
Location: Slovakia
Posts: 108
Thanks: 9
Thanked 0 Times in 0 Posts
Trki is an unknown quantity at this point
hm... any ideas how to convert line feed (shift+enter) to normal line break (enter) ? :P
Trki is offline   Reply With Quote
Old 10-20-2012, 08:51 PM   PM User | #3
bjarneo
New Coder

 
Join Date: May 2012
Posts: 50
Thanks: 6
Thanked 4 Times in 4 Posts
bjarneo is an unknown quantity at this point
I actually don't understand what you need?

Anyways if you use shift+enter you get \n or \r\n. Can't remember right now.

So if you want to replace let's say \n with <br /> you do it like this:

PHP Code:
$str "Hello \n World";
$str str_replace('\n''<br />'$str); 
bjarneo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:25 AM.


Advertisement
Log in to turn off these ads.