Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.
Small class-based php program to grab the latest stocks (specified in the url [stock.php?symbols=YHOO,MSFT,etc...]). I forget where I got the original source from, but I edited it to enhance a small section of my website. Enjoy
you can use them as entropy data for seeding randoms pretty easy.. however using them straight.. I dunno.. need to talk to a lawyer, but I'd guess it's "okay"
Thank you so much for this. I am a real amateur .. I found a stock ticker online, for a client who wanted it on a website I am building - here is the code:
It works great, but is missing the code to get the actual stock info. Can I use your script to modify this? If so, could I trouble you to tell me where to add it into this code? Thank you so much!
Last edited by mybelle on Thu Jun 10, 2010 5:25 pm, edited 2 times in total.
Thank you so much for this. I am a real amateur .. I found a stock ticker online, for a client who wanted it on a website I am building - here is the code:
<?php
///// Replace with Yahoo Finance stock quotes of your choice //////
$raw_stock_data = array('AAPL 200 205',
'BIDU 500 510','RIMM 150 155', 'SNDK 70 72',
'GOOG 500 510','MSFT 30 32','AMD 9 10');
sort($raw_stock_data);
//////////////////////////////////////////////////////////////////////////
?>
<div align="center">
<marquee bgcolor="#e0e1e1" direction="left" loop="20" width="100%%">
<?php
foreach ($raw_stock_data as $value) {
$results = explode(' ',$value);
echo "<font color=\"#ffffff\">$ticker </font>";
echo "<font color=\"#00ff00\">$buy </font>";
echo "<font color=\"#ff0000\">$sell </font>";
echo " ";
}
?>
It works great, but is missing the code to get the actual stock info. Can I use your script to modify this? If so, could I trouble you to tell me where to add it into this code? Thank you so much!