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. sorted. echo $rankseasoncart[$numbera];
  2. 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. 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. Thanks. When I view it in the web page - the team names and prices aren’t there.....
  6. 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. 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. Yes I’m more convinced the page blocks scraping and you need a certificate. (Is that what you just said!)
  9. 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/mo
  10. 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
  11. Thanks both. What’s the name of the new ranked array, Barand?
  12. 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
  13. 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)
  14. Ah thanks. If the "secret equation" is kept secret or at least the data it generates, then this may be the ticket. Thanks all.
×
×
  • 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.