Posts
javascript正則表達式中用於replace
正則表達式我經常用,但是用的都是最基礎的,基本上都是用於驗證一個字符串的合理性。例如: var m=”12345″; var n=/^\d+$/; if(n.test(m)) alert(‘ok’); 今天看了一個關於replace方法中用正則
Posts
PHP MySQL Tips
Continuing from my earlier post on PHP performance, I thought I’d share a few Mysql tips that I’ve learnt over the years. Hope it helps someone and please leave a comment with your own tips or provide any corrections to the ones mentioned. Word searching 1.
SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('Keyword') (Fastest)
2.
SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('+Keyword' IN BOOLEAN MODE) (Fast)