1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

array search problem

Discussion in 'Plugin Help' started by Muhammed0232, Oct 8, 2020.

  1. Muhammed0232

    Muhammed0232 Spider Jockey

    Messages:
    38
    GitHub:
    Muhammed0232
    PHP:
     /**
         * @param string $faction
         * @throws \InvalidStateException
         */

        
    public function unsetHome(string $faction){
            
    $factionData $this->getFactionData();
            
    $ar $factionData->get($faction, []);
            
    $search array_search("Home"$ar);
            unset(
    $ar[$search]);
            
    var_dump($search);
            
    $factionData->save();
        }

    var 
    dump string(4"Gems"
    $faction 123
    upload_2020-10-8_21-48-41.png
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.