在此代码中正确放置strtolower()

时间:2012-10-05 04:23:28

标签: php

我想将strtolower()添加到下面的代码

$skin = new skin('movie/similar_rows'); $similar_rows = '';
while ($TMPL = mysql_fetch_assoc($similar_result)) {
$TMPL['title_encoded'] = str_replace("+", "-", urlencode($TMPL['title']));

我尝试了以下代码,但它不起作用:

$skin = new skin('movie/similar_rows'); $similar_rows = '';
while ($TMPL = mysql_fetch_assoc($similar_result)) {
$TMPL['title_encoded'] = strtolower(str_replace("+", "-", urlencode($TMPL['title'])))

有什么建议吗?

我对编码很陌生,所以不要跳我!

1 个答案:

答案 0 :(得分:1)

您在修改过的行的末尾错过了分号。

要调试此类情况(假设您在本地计算机上开发,而不是在生产中),最好:

  1. error_reporting级别设置为E_ALL
  2. 输出错误到屏幕:display_errors = on
  3. 您可以在手册http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting

    中详细了解这些指令
相关问题