Search code examples
phpstrip

Stripping text from url


Im trying to strip find_loc= and &cflt=pizza I got the majority stripped its just these last 2 things and whenever I try to use trim it doesn't delete it out it keeps saying array even when i try to print it, it says array.

<?php
    $foo = 'http://www.yelp.com/search?find_loc=2190+W+Washington+Blvd%2C+Los+Angeles+90018&cflt=pizza ';

    $blah = parse_url($foo);

    $blah[query];

//the code above echos out find_loc=2190+W+Washington+Blvd%2C+Los+Angeles+90018&cflt=pizza

    $thids = trim(''.$blah.'','find_loc=');

    echo $thids;
    ?>

Solution

  • $thids = str_replace(array('&cflt=pizza','find_loc='), '', $blah);