1. Go to this page and download the library: Download sakura-internet/saklient 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/ */
$servers = $api->server->find();
// This doesn't work well
while ($server = array_shift($servers)) {
//...
// The same goes for accessors
while ($tag = array_shift($server->tags)) {
//...
}
}
// This works well
$servers_array = (array)$servers;
while ($server = array_shift($servers_array)) {
//...
$tags_array = (array)$server->tags;
while ($tag = array_shift($tags_array)) {
//...
}
}
// This works well because ArrayObject implements IteratorAggregate
foreach ($servers as $server) {
//...
foreach ($server->tags as $tag) {
//...
}
}
// This works well too because ArrayObject implements ArrayAccess and Countable
for ($i=0; $i < count($servers); $i++) {
$server = $servers[$i];
//...
for ($j=0; $j < count($server->tags); $j++) {
$tag = $server->tags[$j];
//...
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.