Removing a line wrap

    Date: 11/07/07 (PHP Community)    Keywords: no keywords

    I'm stuck trying to remove a line wraps from a string:

    $str = "
                            `val_div_phe_value`,
                            `val_div_phe_status`,
                            `met_div_phe_value`,
                            `met_div_phe_status`

    ";

    So I tried this:

        $str = str_replace('\r', '', str_replace('\n', '', $str));

    No luck.

    Any ideas?

    Answer
    Digitalsidhe noticed that I was using single quotes. To look for and replace special characters like \n double quotes must be used.

        $str = str_replace("\r", '', str_replace("\n", '', $str));

    Source: http://community.livejournal.com/php/594835.html

« Unknown column __ in... || Fatal error: Allowed memory... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home