I'm twiting

访问统计

free counters

file_get_contents和\n的那些事

用file_get_contents去获取一段url的内容,结果总是显示404,实际上页面是存在的。搞了半天不明白,后来发现报错的url后带一个空白,猜想可能是url后面多了\n的话file_get_contents就会报错,就在url上加了个trim,马上就成功了!!-_-这file_get_contents的容错性真是……

1 comment to file_get_contents和\n的那些事

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>