Jump to content

muppet77

Members
  • Content count

    142
  • Joined

  • Last visited

Community Reputation

0 Neutral

About muppet77

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. muppet77

    curly bracket, variable variable

    sorted. echo $rankseasoncart[$numbera];
  2. muppet77

    curly bracket, variable variable

    Hi and thanks. It’s part of a bigger script where I need to change $numbera frequently. Can it be done?
  3. Hi, I have $rankseasoncart[0] = 3; $rankseasoncart[1] = 4; $rankseasoncart[2] = 5; and i want to write a piece of code so i can call each one separately by having a variable inside the square brackets. This doesn't work at all $numbera=1; echo ${"rankseasoncart[".$numbera."]"}; what silly error have I made? if i do echo $rankseasoncart[1]; as a test, it works fine! thanks.
  4. muppet77

    File get contents

    Hi I’m on my phone at the moment but it’s view source of https://www.spreadex.com/sports/mobile/page/spr/596301/1/10047 is that’s what you mean? I’m after the team names and their spread point estimates. Eg Manchester City 98-99.5
  5. muppet77

    File get contents

    Thanks. When I view it in the web page - the team names and prices aren’t there.....
  6. muppet77

    File get contents

    Hi giner jm Actually that is all my code! I’ve added HTML entities because without it, the actual webpage appears in my browser. Without it, I can see the source code to see if the teams are there and what to then target to extract the team names one by one.
  7. muppet77

    File get contents

    Ok thanks. echo htmlentities(file_get_contents(“url”)); Is what I’m using. The output doesn’t have the team names in, as per when you visit the actual page (as above) Thanks
  8. muppet77

    File get contents

    Yes I’m more convinced the page blocks scraping and you need a certificate. (Is that what you just said!)
  9. muppet77

    File get contents

    I’d like to get the points estimates and fooball team names from a site as variables in php. I’ve tried file get contents and also htmlentities but I can’t seem to spot the team names or prices in there. What’s happening? Why don’t they appear in my php output? One site is https://mobile.sportingindex.com/markets/4855dfa3c28b43ceb332768100728224/c0c1dc8fc78347cca90c48e40328a64b/group_a.7e4187d6-9e42-4bb0-9bde-779fd4019f61/00000000000000000000000000000000/ And another that gives the same data so will also be ok to use instead of the first is https://www.spreadex.com/sports/mobile/page/spr/596301/1/10047 Thanks for any help.
  10. muppet77

    small tweak to rank an array

    Cheers buddy. Appreciated.
  11. muppet77

    small tweak to rank an array

    haha. thanks Barand. I've now realised that my data are non - integer numbers and so ranking doesn't quite work anymore in this way. i have an integer and i've added a random number that has about 5 decimal places - i then need to rank these non integers in the array. Is there a quick and easy fix to rank non integers? thanks
  12. muppet77

    small tweak to rank an array

    Thanks both. What’s the name of the new ranked array, Barand?
  13. with this third party code function rank($input) { $output = array(); $ranking = $input; sort($ranking); $ranking = array_flip($ranking); $last_val = -1; foreach($ranking as $key => $val){ $repetitions = ($val-$last_val-1); $last_val = $val; if($repetitions) { $ranking[$key] = (($val*($repetitions+1))-($repetitions+1)*(($repetitions)/2))/($repetitions+1)+1 ; } else { $ranking[$key] = $val+1; } } foreach($input as $key => $val){ $output[$key] = $ranking[$val]; } return $output; } $a = array(4,76,34,13,34); $c = rank($a); print_r($c); that ranks an array, how could i tweak it to rank the other way round, so the highest value = 1, etc? thanks
  14. muppet77

    Securely pass data

    Right think I've done it. If I post a URL please could someone have a look to see what "hidden" info you can get at, if any? (Not sure if I can post urls)
  15. muppet77

    Securely pass data

    Ah thanks. If the "secret equation" is kept secret or at least the data it generates, then this may be the ticket. Thanks all.
×

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.