Twitter Search api 以 ATOM/XML 格式返回结果,如下所示:
<author>
<name>username (Friendly Name)</name>
<uri>http://twitter.com/username</uri>
</author>
在我的 PHP 中,我可以将 name 字段作为变量,所以它看起来像这样:
$names = "username (Friendly Name)"
但我想使用 PHP 将它们提取为单独的变量,如下所示:
$username = "username"
$friendlyName = "Friendly Name" (without parantheses)
蒂亚!