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

split string
Hi all

i have some names (imploded by comma):
Code: toronto,paris,madrid
Now, i would

Problem assigning value to variable in "IF" function
Does this script makes sense? I am trying to take the value that is set to "authenticat" a

passthru() help
Hi everyone,
I'm new to the forum and to PHP. I have some pretty good experience writing shell sc

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h

WELCOME SCREEN
first of all let me tell you what does my script do,

it´s a very simple query to show a e

Greek characters in php
Hi,

I'm making a script and I m using for first time greek characters.
I started to write

Help With editting and deleting form
So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.png
This table

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