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

Sequencing or queuing parallel process
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

image upload, resize THEN submit form
Ok so I have a form that requires the user to upload an image, and then do something with that image

remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to

how to insert value
I am having file bookissueadd.php..... in which i am having tag

<td height="21&q

Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages

Undefined index: username HELP NEWBIE
I am trying a simple login/logout for my website. It works well with checking if the username exists

single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag w

Varible in trigger - refering to correct schema
Hello

Im having some issues with my trigger.
What I want to do is call opon a differ

Create a form of 2 numbers input and find the greatest.
Hi, everybody.

I have a homework in my training of php, which ask you to make a form that ask

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