статья с описанием - http://habrahabr.ru/post/233243/
Поулчаем список городов http://weather.yandex.ru/static/cities.xml https://pogoda.yandex.ru/static/cities.xml
статья с описанием - http://habrahabr.ru/post/233243/
Поулчаем список городов http://weather.yandex.ru/static/cities.xml https://pogoda.yandex.ru/static/cities.xml
| <?php | |
| //via http://php.net/manual/en/function.getimagesize.php#109063 | |
| $header = unpack('@6/vwidth/vheight', $binaryData); | |
| $width = $header['width'] | |
| $height = $header['height']; |
| <?php | |
| require_once "jBBCode" . DIRECTORY_SEPARATOR . "Parser.php"; | |
| /** | |
| * Implements a [list] code definition that provides the following syntax: | |
| * | |
| * [list] | |
| * [*] first item | |
| * [*] second item |
| <?php | |
| require_once "jBBCode" . DIRECTORY_SEPARATOR . "Parser.php"; | |
| /** | |
| * Implements an [img=alt] tag that supports an optional class argument. | |
| * | |
| */ | |
| class ImageWithClass extends \JBBCode\CodeDefinition | |
| { |
| <?php | |
| //to Parser.php | |
| public function unparse($str) | |
| { | |
| $tags_with_options = array(); | |
| $tags_without_options = array(); | |
| foreach ($this->bbcodes as $code) | |
| { |
| <?php | |
| //via http://stackoverflow.com/questions/6409462/downloading-a-large-file-using-curl | |
| function curl_copy($from = '', $to = '', $proxy = '') | |
| { | |
| if(empty($from) || empty($to)) | |
| { | |
| return false; | |
| } |
| <?php | |
| $fp = fopen($cuts_list_file, 'rb'); | |
| while(!feof($fp)) | |
| { | |
| $line = fgets($fp); //fgets reads one line at a time | |
| } |