public static function wikiSearch($keyword)
    {
        $apiurl = 'http://wikipedia.org/w/api.php?action=opensearch&search='.urlencode($keyword).'&format=xml&limit=1';
        $data = self::curl($apiurl);
        $xml = simplexml_load_string($data);
        if ((string) $xml->Section->Item->Description) {
            $array = [];
            $array['title'] = (string) $xml->Section->Item->Text;
            $array['description'] = (string) $xml->Section->Item->Description;
            $array['url'] = (string) $xml->Section->Item->Url;
            if (isset($xml->Section->Item->Image)) {
                $img = (string) $xml->Section->Item->Image->attributes()->source;
                $array['image'] = str_replace('/50px-', '/200px-', $img);
            }

            return $array;
        }

        return false;
    }
public static function wikiSearch($keyword)
    {
        $apiurl = 'http://wikipedia.org/w/api.php?action=opensearch&search='.urlencode($keyword).'&format=xml&limit=1';
        $data = self::curl($apiurl);
        $xml = simplexml_load_string($data);
        if ((string) $xml->Section->Item->Description) {
            $array = [];
            $array['title'] = (string) $xml->Section->Item->Text;
            $array['description'] = (string) $xml->Section->Item->Description;
            $array['url'] = (string) $xml->Section->Item->Url;
            if (isset($xml->Section->Item->Image)) {
                $img = (string) $xml->Section->Item->Image->attributes()->source;
                $array['image'] = str_replace('/50px-', '/200px-', $img);
            }

            return $array;
        }

        return false;
    }
public static function wikiSearch ( $ keyword ) { $ apiurl = 'http://wikipedia.org/w/api.php?action=opensearch&search=' . urlencode ( $ keyword ) . '&format=xml&limit=1' ; $ data = self :: curl ( $ apiurl ) ; $ xml = simplexml_load_string ( $ data ) ; if ( ( string ) $ xml -> Section -> Item -> Description ) { $ array = [ ] ; $ array [ 'title' ] = ( string ) $ xml -> Section -> Item -> Text ; $ array [ 'description' ] = ( string ) $ xml -> Section -> Item -> Description ; $ array [ 'url' ] = ( string ) $ xml -> Section -> Item -> Url ; if ( isset ( $ xml -> Section -> Item -> Image ) ) { $ img = ( string ) $ xml -> Section -> Item -> Image -> attributes ( ) -> source ; $ array [ 'image' ] = str_replace ( '/50px-' , '/200px-' , $ img ) ; } return $ array ; } return false ; }
Search wikipedia.

@param string $keyword Keywords to search in wikipedia

@return mixed Array or false
Search wikipedia .