Jump to content

nofx1728

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Everything posted by nofx1728

  1. Thanks for your help everyone. You make a good point mangy I'm going to do some additional research on that and in the short term use the @ symbol.
  2. Hi, sorry to come back once again with another question on this issue but I just discovered a new problem. Is there anyway to create a statement that will display the above information if it gathers it correctly, but not display anything at all if I get an error retrieving the information? Right now I get a large code error on my screen that is throwing my layout off. [attachment deleted by admin]
  3. Awesome. Thank you so much. This is so much cleaner then what I had come up with to get it to work. Thanks again for all your help.
  4. I modified the code a little and used an if statement instead of a for statement - coming up with this code. <?PHP $content = file_get_contents('http://www.kitco.com/texten/texten.html'); $content = explode("\n",$content); if($i=39) { $thisLine = explode(' ',preg_replace('/(?:\s\s+|\n|\t)/', ' ',$content[$i]),4); $prices[$thisLine[1]] = '$'.$thisLine[2]; } if($i=40) { $thisLine = explode(' ',preg_replace('/(?:\s\s+|\n|\t)/', ' ',$content[$i]),4); $prices1[$thisLine[1]] = '$'.$thisLine[2]; } if($i=41) { $thisLine = explode(' ',preg_replace('/(?:\s\s+|\n|\t)/', ' ',$content[$i]),4); $prices2[$thisLine[1]] = '$'.$thisLine[2]; } if($i=42) { $thisLine = explode(' ',preg_replace('/(?:\s\s+|\n|\t)/', ' ',$content[$i]),4); $prices3[$thisLine[1]] = '$'.$thisLine[2]; } ?> Then I add it to my html that I want to display: <font><marquee border="1" width="400" height="20" bgcolor="#000000" scrolldelay="10" scrollamount="1" align="middle" style="background-color: #000000; color: #FFFFFF; font-weight: bold;"><?PHP print_r($prices);?> <?PHP print_r($prices1);?> <?PHP print_r($prices2);?> <?PHP print_r($prices3);?> </font> Now the only thing I need to do is figure out a way to remove the Array ( [] ). Is there anyway to just display Gold - $xxxxx - instead of Array ([Gold] => xxxx) ?? Any help would that would be unreal. I've been googling for last 4 hours but can't seem to figure it out.
  5. That is awesome. Is there anywhere I can go to read more about what is taking place in that line of code? How exactly are you selecting only those numbers with all that information on the page? Is there anyway to change how it is outputted? I'm trying to create a finished product like this: <font><marquee border="1" width="400" height="20" bgcolor="#000000" scrolldelay="10" scrollamount="1" align="middle" style="background-color: #000000; color: #FFFFFF; font-weight: bold;>Gold: $1,824. Silver: $41.60 Platinum: $1,843.00 Palladium: $782.00 </marquee></font> I thought maybe removing the \n would accomplish the line break but I tested that and it didn't work. Either way thank you so much for your help. Just getting to this point is great.
  6. I've used a little PHP but I am not great. Is there any way to take information from a html page written in basic text and have it dynamically displayed. The content I want is found here: http://www.kitco.com/texten/texten.html I want to take the information from the following chart - only Metal and Ask and create a ticker. New York Spot Price MARKET IS OPEN Will close in 2 hour 24 minutes ---------------------------------------------------------------------- Metals Bid Ask Change Low High ---------------------------------------------------------------------- Gold 1822.80 1823.80 -12.30 -0.67% 1810.70 1840.90 Silver 41.45 41.55 +0.10 +0.24% 41.08 42.15 Platinum 1844.00 1852.00 -7.00 -0.38% 1826.00 1861.00 Palladium 783.00 788.00 +10.00 +1.29% 775.00 794.00 ---------------------------------------------------------------------- So basically I would just take the word: Gold - $1823.80 Silver - $41.55 Platinum $1852.00 Palladium - $788.00 Can someone help me through this or point me in a direction where I can read more about accomplishing this? I've been searching google for articles but still haven't found what I'm looking for. nofx1728
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.