Results 1 to 2 of 2

Thread: hidden html new line or space?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    366

    hidden html new line or space?

    Hi I am trying to generate a string from some html and other bits and bobs, however I can see what looks like a space when I echo it to the page. However when I save that string to a database, and look at it in the entry, I think it could be a new line, because it appears at that point, on seperate lines. The problem is I cant search for it, because something's going on. I generate it here:
    Code:
    $game_key = str_replace(" ", "", strip_tags($matches[$tournKeys[$c]]).$pieces[0]."VS".$pieces[1].$dt->format('jnY').str_replace(":", "", $pieces[2]));
    It appears on the browser as:
    BarclaysPremierLeague NorwichVSChelsea21120121245
    see the 'space' after League?
    And in the database (using phpmyadmin) when I click edit entry, it appears in the box as:

    BarclaysPremierLeague
    NorwichVSChelsea21120121245
    I dont know whether its just changing line because there's not enough room, however I am stripping the spaces, and its still there. although if I do a search for the exact thing that appears in my browser (copy/paste) it doesnt find it - even when I run the sql from phpmyadmin.
    Any ideas what else I need to 'strip'?

    P.S There might even be a [new line] at the beginning, I dont know

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: hidden html new line or space?

    Try preg_replace() and include both the newline (\n) and carriage return (\r) characters.

Posting Permissions

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



Click Here to Expand Forum to Full Width