2013年8月3日
摘要: php中的sprinf可以格式化字符串的数据类型。今天遇到了想在其中输出%,可难倒我了。$query = sprintf("select * from books where %s like '% %s %'",$searchtype,$searchterm);//我以为输出是这样的:select * from books wheretitle like '%java %' ,但实际上输出会是select * from books wheretitle like '%将其换成这样就可以了:$query = sprintf(" 阅读全文
posted @ 2013-08-03 11:15 any91 阅读(9332) 评论(0) 推荐(0) 编辑