PartKeepr\TipOfTheDayBundle\Services\TipOfTheDayService::extractPageNames PHP Method

extractPageNames() private method

Extracts the page names from the mediawiki JSON returned.
private extractPageNames ( string $response ) : array
$response string The encoded json string
return array An array with the titles of each page
    private function extractPageNames($response)
    {
        $aTipsStructure = json_decode($response, true);
        $aTips = $aTipsStructure['query']['categorymembers'];
        $aPageNames = [];
        foreach ($aTips as $tip) {
            $aPageNames[] = $tip['title'];
        }
        return $aPageNames;
    }