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 Upload issue
Hi guys,

I have stumble across an interesting issue with my script and is doing my head in.

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

Taylor Series Function
So I am working a a project for my intro C++ class, and I am having some trouble with a function for

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

Error with login script
I am getting an error with my login script:

Error:
Code: Warning: Cannot modify header inf

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

finding key position of specified value in multi-dimensional array
Code: $openedfile = fopen($tfc_file4, "r");
$rc = 1;
while(!feof($openedfile))
{<

Display Database
I need to create a shopping cart. I found this code online: http://conceptlogic.com/jcart/
Unfort

phph within href not showing php if change ? to &
Code: [Select]<a href="<?php echo $puser; ?>?m=<?php=(($m-1)&l

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