Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts

    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 11:36 PM.

  • #2
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts
    hm... any ideas how to convert line feed (shift+enter) to normal line break (enter) ? :P

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    50
    Thanks
    6
    Thanked 4 Times in 4 Posts
    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); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •