select
*
from
table
where
replace
(
key
,
' '
''
),
)
like
'%検索文字列%'
// 例:pdoで検索文字列(:KEY)をバインドする方法
// ※\sは[ \t\n\f\r]と同義
// ※utf-8の場合、preg_replaceの修飾子に'u'が必要
$stmt
->bindValue(
':KEY'
'%'
. preg_replace(
'/[\s ]/u'
$key
) .
);
0 件のコメント:
コメントを投稿