status_code, array(200, 201, 202, 203, 204, 205, 206, 404, 501))) { return $response; } $ok = false; $cts = array('text/html', 'text/html', 'application/xhtml+xml'); foreach ($cts as $ct) { if (false !== strripos($response->headers['Content-Type'], $ct)) { $ok = true; break; } } if ($ok == false) { return $response; } $replacead1 = $this->makead(Pluf::f("google_ads")["AD1"]); $replacead2 = $this->makead(Pluf::f("google_ads")["AD2"]); $response->content = substr_replace($response->content, $replacead1, strrpos($response->content,''), strlen('')); $response->content = substr_replace($response->content, $replacead2, strrpos($response->content,''), strlen('')); return $response; } private function makead($ad) { $ret = '"; $ret .= ''; return $ret; } }