Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
finance products
low cost magazines
dvd information
 Downloads
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Multiple ticker symbols


Multiple ticker symbols

We had a query from a user who used our stock ticker script and liked it , there query was how about supporting multiple stock tickers . So we set about creating this updated version of our script .

In this example the user must enter the ticker symbols seperated by a comma like this MSFT , SUN , CNET with no spaces between the symbols.
In the script we now seperate this using the explode function which splits the string into an array using a delimiter , in this case commas . This line looks like this

$symbol = explode("," , $symbol);

We then loop through all of the symbols using a for next loop , here is the for statement in our new example .

for ($i=0 ; $i < sizeof($symbol) ; $i++)
{
print "<br>";
?>
<img border="0" src="http://ichart.yahoo.com/t?s=<?php print $symbol[$i]; ?>">
<br>
<?php
next;
}
?>

You can get the whole script by viewing the following file and cutting and pasting it .multistock.txt

 




Books
 Sponsors
 Random Code
Display meta tags(internet)
change text in a string(string)
Processor information(functions)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials




beginners PHP Copyright © 2004 onwards by beginnersPHP.