Jump to content

anasather

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by anasather

  1. http://www.khansolicitors.org.uk/karim/short.php?input=13 (any value here "matchno") <?php $input = $_GET["input"]; $diff = 66; $start=1; $inc = 0; for ($i=1; $i<17; $i++) { //echo "start: " . ($start+$i+$inc-1) . " Return: " . ($start +$diff-1) . "<br>"; //echo "start: " . ($start+$i+$inc) . " Return: " . ($start +$diff-1) . "<br>"; //echo "<br><br>"; $anas[] = ($start+$i+$inc-1) . "." . ($start +$diff-1); $anas[] = ($start+$i+$inc) . "." . ($start +$diff-1); $diff++; $inc ++; } foreach ($anas as $val) { if ($input == substr($val, 0, strrpos($val, "."))) { echo "Matchno " . substr($val, 0, strrpos($val, ".")) . " Return " . substr($val, (strrpos($val, ".")+1)) . "<br>"; } } //print_r($anas); ?>
  2. <?php $input = $_GET["input"]; $diff = 66; $start=1; $inc = 0; for ($i=1; $i<17; $i++) { //echo "start: " . ($start+$i+$inc-1) . " Return: " . ($start +$diff-1) . "<br>"; //echo "start: " . ($start+$i+$inc) . " Return: " . ($start +$diff-1) . "<br>"; //echo "<br><br>"; $anas[] = ($start+$i+$inc-1) . "." . ($start +$diff-1); $anas[] = ($start+$i+$inc) . "." . ($start +$diff-1); $diff++; $inc ++; } foreach ($anas as $val) { if ($input == substr($val, 0, strrpos($val, "."))) { echo "Matchno " . substr($val, 0, strrpos($val, ".")) . " Return " . substr($val, (strrpos($val, ".")+1)) . "<br>"; } } //print_r($anas); ?> http://www.khansolicitors.org.uk/karim/short.php?input=13 (Input any value)
  3. thanks anas, this is exackly what I have done but the different won't always be 65. I don't think you seen this yet: http://team-x1.co.uk/site/test.html ?? Yes! Karim, just move $diff inside loop then provide $matchno and $diff from same Multidimensional array like $arr[$i]["matchno"] && $arr[$i]["diff"] That was just for an example//// Good Luck
  4. Yes you are right, I created dynamic Tabular system in OOP that was backed end by massive PHP Code but If it is dynamic it saves time and behaves according to condition
  5. <?php $matchno=6; $diff = 65; for ($i=1; $i<33; $i++) { if ($i = $matchno) { echo "Matchno: " . $i . " Return: " . ($i+$diff) . "<br>"; return $i+$diff; break; } } ?> Try this if it works
×
×
  • 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.