t_string php错误

时间:2013-03-19 05:02:59

标签: php

<?php
$meta_keys = explode(',' stripslashes($row['meta_keys'])); // split into individual keys at commas

foreach ($meta_keys as $key) // loop through all keys
{
    echo '<a href="#">' . trim($key) . '</a> '; // output each key link remove any leading/trailing spaces as well
}

?>

我认为这与我如何使用括号有关,但它给我的错误是:

解析错误:语法错误,第91行/post.php中的意外'stripslashes'(T_STRING)

和91是:$ meta_keys = explode(','stripslashes($ row ['meta_keys']));

你知道它是什么吗?谢谢!

2 个答案:

答案 0 :(得分:3)

您在第一个参数后缺少逗号:

explode(',', stripslashes($row['meta_keys']));

答案 1 :(得分:0)

explode(',' stripslashes($row['meta_keys']));将其更改为:

explode(',', $row['meta_keys']);

参考:http://php.net/manual/en/function.explode.php

参考:http://www.php.net/manual/en/function.stripslashes.php