Herhangi biri bana benim döngü için daha verimli hale getirmek için bazı tavsiyeler verebilir misiniz?

0 Cevap php

So I have this for loop with 36 if-queries inside. Any advice on making it more efficient? You can view the complete code here

İşte neye benzediğini bir örnek:

$numbers = range(1, 36);
shuffle($numbers);  
for ($m =0; $m<37; $m++){
    if ($numbers[$m] == "1"){
        $mirza[$m] = "RUTHIE";
        $mage[$m] = "3";
        $mquote[$m] = "I get to learn a lot of new things here, like sign language!";
        $link[$m] = "http://www.google.com";
    }

    if ($numbers[$m] == "2"){
        $mirza[$m] = "AIDA";
        $mage[$m] = "82";
        $mquote[$m] = "This is like a club and I know and like all the members. It's good therapy.";
        $link[$m] = "/about/";
    }

    if ($numbers[$m] == "3"){
        $mirza[$m] = "AMIRE";
        $mage[$m] = "4";
        $mquote[$m] = "I am learning how to share and make friends.";
        $link[$m] = "/about/";
    }
}

0 Cevap