-3
<?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']));

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

4

2 回答 2

3

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

explode(',', stripslashes($row['meta_keys']));
于 2013-03-19T05:06:37.460 回答
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

于 2013-03-19T05:04:39.317 回答