我在代码ex:
中有一个带回车符的脚本$q = $this->db->prepare("\n\t\t\tINSERT INTO hb_orders(`id`,`number`,`payment_module`,`client_id`,`invoice_id`,\n\t\t\t`total`,`date_created`,`status`,`order_ip`,`notes`) VALUES (\n\t\t\t'',:number,:module,:client,:invoice,\n\t\t\t:total,:date,:status,:ip,:notes\n\t\t\t)\n\t\t");
$q = $this->db->prepare("SELECT dom.*, p.options as tld_options, p.ns as tld_ns, p.nsips as tld_nsip FROM hb_domains dom\r\n LEFT JOIN hb_domain_prices p ON p.product_id=dom.tld_id\r\n WHERE dom.id=? LIMIT 1");
$query = "SELECT mc.*, mc.settings as module_config FROM hb_modules_configuration mc\r\n WHERE mc.active='1' AND (mc.settings LIKE '%isobserver%' ";
如何用PHP代码删除所有内容?
谢谢。
答案 0 :(得分:2)
答案 1 :(得分:1)
您可以使用:
$str = preg_replace("/[\n\r]/", "", $str);