PHP code example of kanashimo / phpwaifu
1. Go to this page and download the library: Download kanashimo/phpwaifu 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/ */
kanashimo / phpwaifu example snippets
// Require autoloader
nstance
$phpwaifu = new \Kanashimo\phpwaifu\phpwaifu();
// Make a request
$request = $phpwaifu->request([
"type" => "sfw",
"category" => "waifu"
]);
// Output image URL
echo $request;
// Require autoloader
nstance
$phpwaifu = new \Kanashimo\phpwaifu\phpwaifu();
// Make a request
$request = $phpwaifu->request([
"type" => "sfw",
"category" => "waifu"
]);
// Print information about the error or output image URL if everything works
if($phpwaifu->err){
echo $phpwaifu->err;
} else {
echo $request;
}