Jump to content

doh85

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

doh85's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Any help guys?
  2. current reg ex : /price\['$from:\S*\s=\s(\S*);/ I want to extend this so not only will it find whats in the $from variable, but to also use the $to variable aswell. Many thanks in advance.
  3. if($ns_cb->targetCurrency == 'USD') { $usd_base_rate = '1'/$ns_cb->value; } $eq = number_format($usd_base_rate*$ns_cb->value,2); echo $eq $ns_cb->value is currently = 0.9940. But this gets updated every day. I keep getting division by zero for this problem here, any help?
  4. doh85

    Reg Ex Help

    Dude, thank you so much. Cheers
  5. doh85

    Reg Ex Help

    You have been a lifesaver. Cheers man. Any help with the final thing, the last dash right at the very bottom?
  6. doh85

    Reg Ex Help

    That has worked a treat, thank you very much. I have one more slight issue, "price['KPW:CUR'] = -99;" this one has not shown up. I have checked the original file to see. This currency is currently unavaliable. How would i go about editing the code to still pull the value of this even if the rate is -99? I have formatted the outputs to be displayed like so: echo $country_code[$i].' - '; echo $rate[$i].' <br/> '; At the very bottom its showing just a '-', how would i go about removing it, it must mean that the value is empty or something like that?
  7. doh85

    Reg Ex Help

    Line 33: preg_match("~price['([^:]+):CUR'] = ([\d\.]+)~", $content[$i], $matches);
  8. doh85

    Reg Ex Help

    $content = file_get_contents(**URL**'); if ($content !== false) { $content = explode(";", $content); $count = count($content); for ($i = 1; $i < $count; ++$i) { echo $content[$i]; } } else { echo "Fail"; }
  9. doh85

    Reg Ex Help

    PM'd you the code
  10. doh85

    Reg Ex Help

    Would it be possible to put this to use in an example please?
  11. doh85

    Reg Ex Help

    I am gathering some data from a website to do with currencies. I have managed to strip out the rates into this format. price['AFN:CUR'] = 45.17 The rates are all structured like this, however i want them to be structured like this, but stored in 2 separate variables. So for example: echo $country_code[$i]; // AFN echo $rate[$i]; // 45.17 AFN 45.17 Any help would be greatly appreciated.
×
×
  • 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.