Skip to content

Instantly share code, notes, and snippets.

<?php
namespace app\components;
class Helpers
{
public static function getDays($month,$year)
{
if ($month==date("m")){
$num=(int)date("d");
}
## Hotels API [/agent/v1/hotel]
### Get hotels availability [GET /agent/v1/hotel/availability{?regions,hotels,from,to,limit,offset,adults,children}]
Pagination available.
| field | required | type | example | description |
|------------|:-:|-------------|----------------------------------------|-------------|
| regions | * | string,int | `399,189` | Comma separeted string of region id's or single id. |
| hotels | | string,int | `1844` | Comma separeted string of hotel ids or single id. |
<?php
class ArrayToXml
{
/**
* @var string the XML version
*/
public $version = '1.0';
/**
* @var string the XML encoding. If not set, it will use the value of [[Response::charset]].
#
# Simple python client example
# Using Python 2.7 and urrlib2 library
#
import time, hashlib
import urllib2
import time
# Your API Key and secret
<?php
use yii\db\Schema;
use yii\db\Migration;
use yii\db\Query;
use yii\helpers\Console;
class m150326_081532_combining_users extends Migration
{
private $affiliatesTable = 'affiliate_users';
<?php
function isPrimeNumber($i)
{
if($i == 1)
return false;
if($i == 2)
return true;
$n = 2;
<?php
/**
* Class Ican
*
* Api for 3rd party service
*
*/
class Ican
{
<?php
namespace app\modules\guides\controllers;
use app\modules\guides\components\Parser;
use yii\filters\AccessControl;
use yii\helpers\Markdown;
use yii\helpers\Url;
use yii\web\Controller;
var currKeypadField;
var keypad;
var checkbox_group_ids = [];
window.onload = function(event) {
keypad = document.getElementById('virtual-keypad');
setBodySize();
var inputs = document.getElementsByTagName("input");
<?php
namespace TrafficTest;
class Traffic
{
private $db;
private $table = 'traffic';
public $code;
public $period;