need a php built-in function to remove tab new line or enter

Discussion in 'PHP' started by mdrobiul, Jul 11, 2009.

  1. #1
    I was making a javascript slideshow from RSSfeed. I was dynimcally gernerating array for javascript. but javascript array does not work if the value is given like this:

    var something = array (a
    b
    c, something, something,
    something)

    but if we give him like var something = array (abc, something, something,something)

    it works then.. as i'm generating it's value with php and i need a function to remove the tabs or new line or whatever you call it.. thanks.
     
    mdrobiul, Jul 11, 2009 IP
  2. php-lover

    php-lover Active Member

    Messages:
    261
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #2
    use trim() function
     
    php-lover, Jul 11, 2009 IP
  3. mdrobiul

    mdrobiul Peon

    Messages:
    186
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    trim() is used for removing spaces..
     
    mdrobiul, Jul 11, 2009 IP
  4. php-lover

    php-lover Active Member

    Messages:
    261
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #4
    trim will strip out the following characters:

    " "
    "\t"
    "\n"
    "\r"
    "\0"
    "\x0B"
     
    php-lover, Jul 11, 2009 IP
  5. mdrobiul

    mdrobiul Peon

    Messages:
    186
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks for your information. i made my application working in different way.
     
    mdrobiul, Jul 11, 2009 IP