php - 如何从 Twitter 消息 ID 'tag:search.twitter.com,2005:7550668919283712' 中删除此标签

标签 php mysql twitter message

当我将任何推文的 ID(如“tweet->id”)存储到表中时,它还会存储来自推特的标签。 id 存储为

tag:search.twitter.com,2005:7550668919283712

我只需要存储 ID,即 2005:7550668919283712。如何从存储到表中删除此标记。

最佳答案

很简单,

str_replace('tag:search.twitter.com,', '', 
  'tag:search.twitter.com,2005:7550668919283712');

如果 tag:search.twitter.com, 始终保持不变

或者使用explodepreg_split性能更好

关于php - 如何从 Twitter 消息 ID 'tag:search.twitter.com,2005:7550668919283712' 中删除此标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4291390/

相关文章:

PHP fatal error : Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\vendor\symfony\process\Pipes\WindowsPipes. php 第 140 行

python - 如果值是字符串列表,如何引用字典中的值?

php - 我是否必须使用准备好的 SQL 语句来清理用户输入?

mysql - SQL/HiveQL : Is there a way to count the number of JOIN <table> ON <condition> matches per row without a group by?

mysql - 按任意顺序对多行进行分组

mysql - 连接到 MySQL 数据库

java - 如何在 OAuth 身份验证期间静态提供 Twitter PIN

twitter - Twitter 的 URL 爬虫执行 JavaScript 吗?

php - 如何修复 Class 'Album\Controller\AlbumController' not found 错误?

php - 在不使用 preg_replace 的情况下比较字母数字值中的十进制数字 - PHP