if (in_array(STYLEID, array(1,3,8))){ $link = array( 'href="http://www.site1.com', 'href="https://www.site1.com' ); $word = array( 'href="http://www.site2.com', 'href="http://www.site2.com' ); $this->post['message'] = str_ireplace($link, $word, $this->post['message']);}