PHP code example of rinvex / universities

1. Go to this page and download the library: Download rinvex/universities library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rinvex / universities example snippets


// Get single university
$cairoUniversity = university('cairo-university');

// Get university name: Cairo University
echo $cairoUniversity->getName();

// Get university alternative name: null
echo $cairoUniversity->getAltName();

// Get university country: Egypt
echo $cairoUniversity->getCountry();

// Get university state: null
echo $cairoUniversity->getState();

// Get university address: {"street":"PO Box 12613, Nahdet Misr Street","city":"Giza","province":"Cairo","postal_code":null}
echo $cairoUniversity->getAddress();

// Get university street: PO Box 12613, Nahdet Misr Street
echo $cairoUniversity->getStreet();

// Get university city: Giza
echo $cairoUniversity->getCity();

// Get university province: Cairo
echo $cairoUniversity->getProvince();

// Get university postal code: null
echo $cairoUniversity->getPostalCode();

// Get university contact: {"telephone":"+20(2) 572-9584","website":"http:\/\/www.cu.edu.eg","email":"[email protected]","fax":"+20(2) 568-8884"}
echo $cairoUniversity->getContact();

// Get university telephone: +20(2) 572-9584
echo $cairoUniversity->getTelephone();

// Get university website: http://www.cu.edu.eg
echo $cairoUniversity->getWebsite();

// Get university email: [email protected]
echo $cairoUniversity->getEmail();

// Get university fax: +20(2) 568-8884
echo $cairoUniversity->getFax();

// Get university funding: Public
echo $cairoUniversity->getFunding();

// Get university languages: null
echo $cairoUniversity->getLanguages();

// Get university academic year: September to June (September-January; January-June)
echo $cairoUniversity->getAcademicYear();

// Get university accrediting agency: null
echo $cairoUniversity->getAccreditingAgency();


// Get all universities
$universities = universities();

// Get all universities in Egypt (by country code)
$egyptUniversities = universities('eg');