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

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

RFQ Configuration - can you make PLANT field an optional field in ME42
Is there a way to make the plant field on an RFQ optional in change mode (ME42)?

Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything

Apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

Email/MMS to Site
Hey guys. I'm looking for a way for a user to upload images and/or text via their cell phones. It

comparing tables across databases sql refinement ideas required
Hi all

Via pl/sql I need to ensure that data between tables in different databases match

php code generators
All

Whilst enjoying learning a new language i have come accross a number of free code generat

Unexpected T_Variable ?
Hi all,
I dont really know what I am doing!! I know I'm doing something wrong, and I know its on

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

Please help with SMTP Authenticated PHP Email Form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

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