strstr返回空行而不是字符串的第一部分

时间:2012-11-21 19:02:52

标签: php concatenation strstr

我正在尝试连接WordPress中RSS源的字段。一个示例数据是:

The Scala in London, - David Ford is touring the UK in support of his brand new 
album, 'Charge', released in March 2013

使用以下代码显示:

<?php echo esc_html( $item->get_description() ); ?>

我希望它在,之前停止 - 因此显示“伦敦的斯卡拉”

我已使用此代码代替上述代码:

<?php echo strstr($item->get_description, "-"); ?>

然而它只返回一个空行。我做错了什么?

0 个答案:

没有答案