Inserting a variable in a link


Posted on 16th Feb 2014 07:03 pm by admin

I have this code that I want to insert for my own variable but I have no idea how. This is what I want to insert:

Code: <?php echo $my_twitter_username; ?>
Into this code:

Code: <?php
[i]function twittercount () { // I added this myself, not sure if I should, but if not there line below does not work
global $my_twitter_username; // Im sure this is needed or the call in will not work.[/i]
$tw = get_option("twitterfollowerscount");
if ($tw['lastcheck'] < ( mktime() - 3600 ) )
{
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=[u][b]WANT TO INSERT HERE[/b][/u]');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$tw['count'] = $match[1];
}
$tw['lastcheck'] = mktime();
update_option("twitterfollowerscount",$tw);
}
echo $tw['count'];
}
?>

No comments posted yet

Your Answer:

Login to answer
347 Like 24 Dislike
Previous forums Next forums
Other forums

Problem with variable declaration in switch statement
Hello, I am having some trouble assigning a value to a variable inside a switch statement. What I a

Slow data retrieval which requires improvement..please help
I am working on a Help Desk Ticketing system and have a page called MY TICKETS which shows all ticke

Post, not working, please help
The error is:
Method Not Allowed
The requested method POST is not allowed for the URL /student

Delete all files in folder except with certain name
I have a script that I want to delete all files in a folder (taken from a database) except for one n

value not going in data base
hello friends....
i am having a working javascript....when i am selecting any

Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will

import table with dependency
Hi

What is the best way to import table back which has dependency?

SQL> cre

Google Wave
So... has anyone used it yet? Is it any good?

http://wave.google.com/help/wave/about.html#vid

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

CURL XML Request [From C to PHP]
Hi,

I need some help converting this into something that will work with PHP.

Code: #

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash