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 Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

insert quotes
Hi,

I have an output like this:
Code: john,18,Cancer
How can I change this to
Code:

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im j

Downloading file (Headers)
I'm trying to make users download a file, but they must wait 60 seconds before it begins.

But

php + mysql count consecutive data
I have a database of values and I want to work out how to display them if the values match a consecu

foreach and array need help combining
Hi guys.

Here's the code

Code: array(
'tag' => 'code',<

a function to check directory depth
I'm working on a php script to upload files in to a set directory.
the user can select to upload

Filling gaps in dates
So i'm doing a query for sales data and my return array looks like this

('date' => '20

Parse Error Help
Hello, I got the parse error "Parse error: syntax error, unexpected ',' in register.php on line

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