0

When I store into table the id of any tweet like 'tweet->id', its also stores a tag from twitter with it. The id is stored as

tag:search.twitter.com,2005:7550668919283712

I need to store only id i.e. 2005:7550668919283712. How do I remove this tag from being stored into table.

2 Answers 2

3

Simply,

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

if the tag:search.twitter.com, always remain unchanged

Or use explode which perform better than preg_split

0
1

http://ideone.com/xC8tw

$arr = preg_split("/,/", "tag:search.twitter.com,2005:7550668919283712");
$str = $arr[1];
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.