PHP code example of grow-services / growclient-php

1. Go to this page and download the library: Download grow-services/growclient-php 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/ */

    

grow-services / growclient-php example snippets


    use GrowClient;
    use GrowChart\Common\Pregnancy;
    
    
    // This factory can get all client. rest xml and soap.
    $client = ClientFactory::getInstance()->getClient('rest', $apikey, $apisecret);
    
    $preg = new Pregnancy();
    
    $preg->setEdd($edd);
    $preg->setEthnicity($eoc->client->spirit_ethnicity->toString());
    $preg->setParity($para);
    $preg->setMaternalheight($length);
    $preg->setMaternalweight($weight);
    $preg->setGrowchartversion($version);
    $preg->setGrowchartid($growchartid);
    
    $chart = $client->registerPregnancy($preg);
    
    print_r($chart);