我有以下代码:
$string = "zero Or one OR two or three";
print_r(explode("or", $string));
现在,这导致:
Array ( [0] => zero Or one OR two [1] => three )
但我想忽略分隔符的情况,因此它适用于Or
,OR
,...我的结果是:
Array ( [0] => zero [1] => one [2] => two [3] => three )
我该怎么做?
答案 0 :(得分:1)
CREATE TRIGGER trMyTable_Update ON parent AFTER UPDATE
AS
IF not exists (select 1 from deleted)
return
if exists (select 1 from deleted where SEARCHID IS NOT NULL)
AND (UPDATE(SEARCHID) OR UPDATE(SEARCHID)) -- attempt to change existing values
begin
raiserror('You can not change values in SEARCHID or ANYOTHER once they were saved!',16,1)
rollback
end
输出:
$string = "zero Or one OR two or three";
$keywords = preg_split("/or/i", $string);
echo '<pre>';print_r($keywords);echo '</pre>';