PHP code example of tigo / chatterbot

1. Go to this page and download the library: Download tigo/chatterbot 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/ */

    

tigo / chatterbot example snippets


 //Somewhere in your project, you may need to use autoload
 

   use Tigo\ChatterBot\Bot\BotUniversal; // import class
   use Tigo\ChatterBot\Response; //import class

  $response  = new Response(new BotUniversal);
  
  //using local array data | return string
  print $response->check("Good Afternoon"); // random result = ["Good Afternoon","Hi","Hello"]
  
  //fetching information from a database | return string
  print $response->checkDataBase("Good Afternoon"); // random result = ["Good Afternoon","Hi","Hello"]