<?php /** * Upload * * @author Josh Lockhart <info@joshlockhart.com> * @copyright 2012 Josh Lockhart * @link http://www.joshlockhart.com * @version 2.0.0 * * MIT LICENSE * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace Upload; /** * FileInfo Interface * * @author Josh Lockhart <info@joshlockhart.com> * @since 2.0.0 * @package Upload */ interface FileInfoInterface { public function getPathname(); public function getName(); public function setName($name); public function getExtension(); public function setExtension($extension); public function getNameWithExtension(); public function getMimetype(); public function getSize(); public function getMd5(); public function getDimensions(); public function isUploadedFile(); } 파일 업로드는 다중 파일 업로드, 드래그 앤 드롭 업로드, 진행률 표시줄, 파일 확인, 이미지 오디오 및 비디오 미리 보기, 도메인 간 업로드 등을 지원하는 매우 강력한 파일 업로드 처리 플러그인입니다. 생각하실 수 있는 모든 기능을 갖추고 있다고 할 수 있습니다. 예상하지 못한 기능도 있습니다. . 그러나 기능이 너무 강력하기 때문에 사용하려면 여전히 몇 가지 기본 기술이 필요합니다. 그렇지 않으면 디버깅 및 개발에 어려움을 겪게 됩니다.
<?php if(php_sapi_name() !== "cli") { echo "<p>Run this php script from the command line to see CLI syntax highlighting and formatting. It support Unix pipes or command line argument style.</p>"; echo "<pre><code>php examples/cli.php \"SELECT * FROM MyTable WHERE (id>5 AND \`name\` LIKE \"testing\");\"</code></pre>"; echo "<pre><code>echo \"SELECT * FROM MyTable WHERE (id>5 AND \`name\` LIKE \"testing\");\" | php examples/cli.php</code></pre>"; } if(isset($argv[1])) { $sql = $argv[1]; } else { $sql = stream_get_contents(fopen("php://stdin", "r")); } require_once(__DIR__.'/../lib/SqlFormatter.php'); echo SqlFormatter::format($sql);SQL은 특수 목적 프로그래밍 언어인 구조적 쿼리 언어(Structured Query Language)로, 데이터에 액세스하고 관계형 데이터베이스 시스템을 쿼리하고 업데이트 및 관리하는 데 사용되는 데이터베이스 쿼리 및 프로그래밍 언어입니다. 데이터베이스 스크립트 파일. SQL 문에는 종류와 양이 많고, 많이 사용되는 문이 대표적인 예입니다. 고급 쿼리이든 하위 수준 쿼리이든 SQL 쿼리 문에 대한 수요가 가장 많습니다.
<?php namespace PhpUnitsOfMeasure; /** * Physical quantities with this trait * have units which are metric and therefore have * a standard set of prefixes. */ trait HasSIUnitsTrait { protected static function addMissingSIPrefixedUnits( UnitOfMeasure $siUnit, $toBaseSiUnitFactor, $namePattern, array $aliasPatterns = [] ) { /** * The standard set of SI prefixes */ $siPrefixes = [ [ 'abbr_prefix' => 'Y', 'long_prefix' => 'yotta', 'factor' => 1e24 ], [측정이란 관찰된 현상을 특정 규칙에 따라 설명하기 위해 데이터를 사용하는 것, 즉 사물을 정량적으로 설명하는 것입니다. 측정은 수량화되지 않은 물리적 대상을 수량화하는 과정입니다. 기계공학에서 측정이란 측정량과 표준량을 측정 단위로 수치적으로 비교하여 둘 사이의 비율을 결정하는 실험적 이해 과정을 말합니다.
<?php ini_set('display_errors', 1); error_reporting(E_ALL ^ E_NOTICE); use Crisu83\Conversion\Quantity\DigitalInformation\DigitalInformation; use Crisu83\Conversion\Quantity\Length\Length; use Crisu83\Conversion\NumberBase\NumberBase; use Crisu83\Conversion\Size\HatSize\HatSize; use Crisu83\Conversion\Size\ShoeSize\ChildShoeSize; use Crisu83\Conversion\Quantity\Length\Unit as LengthUnit; use Crisu83\Conversion\Quantity\DigitalInformation\Unit as DIUnit; use Crisu83\Conversion\Size\HatSize\System as HatSizeSystem; use Crisu83\Conversion\Size\ShoeSize\System as ShoeSizeSystem; require(dirname(__DIR__) . '/vendor/autoload.php'); $length = new Length(1, LengthUnit::METRE); echo $length . '<br>'; echo $length->add(1, LengthUnit::FOOT) . '<br>'; echo $length->add(5)->sub(2, LengthUnit::FOOT) . '<br>'; echo $length->to(LengthUnit::YARD) . '<br>'; echo '<br>';측정이란 관찰된 현상을 특정 규칙에 따라 설명하기 위해 데이터를 사용하는 것, 즉 사물을 정량적으로 설명하는 것입니다. 측정은 수량화되지 않은 물리적 대상을 수량화하는 과정입니다. 기계공학에서 측정이란 측정량과 표준량을 측정 단위로 수치적으로 비교하여 둘 사이의 비율을 결정하는 실험적 이해 과정을 말합니다.
<?php require_once(__DIR__ . '/../vendor/autoload.php'); // Let's consider some really basic examples. echo '<pre>'; // Adding up elements in an array. But wait! First we need an array... // Let's get a random sample of 50 values, in the range 0, 100. $random = NumbersPHP\Statistic::randomSample(0, 100, 50); echo 'Random = {' . implode(', ', $random) . "}\n"; // Add them up... $sum = NumbersPHP\Basic::sum($random); echo 'Sum of Random = ' . $sum . "\n"; // We can do some other cool stuff as well. Like find the GCD between // two integers. $gcd = NumbersPHP\Basic::gcd(100, 10); echo 'GCD amongst 100 and 10 = ' . $gcd; echo '</pre>';많은 양의 디지털 데이터를 처리해야 한다면 이 라이브러리를 꼭 활용해보세요.
<?php if( file_exists(dirname(__FILE__).'/nicejson/nicejson.php') ) { include_once dirname(__FILE__).'/nicejson/nicejson.php'; } require_once dirname(__FILE__).'/../Mobile_Detect.php'; $detect = new Mobile_Detect; $json = array( // The current version of Mobile Detect class that // is being exported. 'version' => $detect->getScriptVersion(), // All headers that trigger 'isMobile' to be 'true', // before reaching the User-Agent match detection. 'headerMatch' => $detect->getMobileHeaders(), // All possible User-Agent headers. 'uaHttpHeaders' => $detect->getUaHttpHeaders(), // All the regexes that trigger 'isMobile' or 'isTablet' // to be true. 'uaMatch' => array( // If match is found, triggers 'isMobile' to be true. 'phones' => $detect->getPhoneDevices(), // Triggers 'isTablet' to be true. 'tablets' => $detect->getTabletDevices(), // If match is found, triggers 'isMobile' to be true. 'browsers' => $detect->getBrowsers(), // If match is found, triggers 'isMobile' to be true. 'os' => $detect->getOperatingSystems(), // Various utilities. To be further discussed. 'utilities' => $detect->getUtilities() ) );문자열은 주로 프로그래밍에 사용됩니다. 개념 설명, 함수 설명 및 자세한 사용법은 본문을 참조하세요. 추가 사항은 다음과 같습니다. 문자열은 저장소의 문자 배열과 유사하므로 각 개별 요소를 추출할 수 있습니다. s = "abcdefghij"와 같이 s[1]="a", s[10]="j"이고 문자열의 0 위치는 s[0]=10과 같은 길이입니다(※ Ansistring은 그렇지 않습니다). ), 이는 우리에게 많은 편의를 제공할 수 있습니다. 예를 들어 고정밀 연산 중에 각 비트를 숫자로 변환하여 배열에 저장할 수 있습니다.
<?php use \mageekguy\atoum; define('COVERAGE_TITLE', 'MetaYaml'); define('COVERAGE_DIRECTORY', './web/coverage'); define('COVERAGE_WEB_PATH', 'http://localhost/meta-yaml/coverage'); if(false === is_dir(COVERAGE_DIRECTORY)) { mkdir(COVERAGE_DIRECTORY, 0777, true); } $script->addTestAllDirectory(__DIR__ . '/test'); $stdOutWriter = new atoum\writers\std\out(); $coverageField = new atoum\report\fields\runner\coverage\html(COVERAGE_TITLE, COVERAGE_DIRECTORY); $coverageField->setRootUrl(COVERAGE_WEB_PATH); $cliReport = new atoum\reports\realtime\cli(); $cliReport ->addWriter($stdOutWriter) ->addField($coverageField, array(atoum\runner::runStop)) ; $runner->setBootstrapFile('test/bootstrap.php'); $runner->addReport($cliReport);AML은 "Another Markup Language"의 외국어 약어인데, 이 언어가 데이터 중심이라는 점을 강조하기 위해 마크업 언어에 중점을 두지 않고 기본으로 돌아가는 단어로 이름을 바꿨습니다. 컴퓨터가 인식할 수 있는 직관적인 데이터 직렬화 형식으로 인간이 읽기 쉽고 읽기 쉬운 프로그래밍 언어이며, 데이터 시퀀스를 표현하는 데 사용됩니다. Standard Universal Markup Language의 하위 집합인 XML과 유사한 데이터 설명 언어이며 구문은 XML보다 훨씬 간단합니다.
<?php error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . '/vendor/autoload.php')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n" . "See http://getcomposer.org for help with installing composer\n"); } // Include the Composer autoloader $loader = include realpath(dirname(__FILE__) . '/../vendor/autoload.php');누군가가 온라인에서 그러한 요구 사항을 언급하는 것을 봤습니다. 16진수 '00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56 13 5fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3 ece0462db0a22b8e7'을 10진수로 변환하면 이러한 큰 숫자를 풀기 위해 일반적인 hexdec() 메서드를 사용하면 결과는 1.5779475026713E+308입니다. 정확성이 심각하게 손실됩니다. 따라서 많은 수를 처리하기 위한 수학 마스터 PHP 라이브러리가 사용됩니다. 도움이 필요한 친구들은 다운로드하여 사용할 수 있습니다.
<?php namespace libphonenumber; /** * Class AsYouTypeFormatter * A formatter which formats phone numbers as they are entered. * * An AsYouTypeFormatter instance can be created by invoking PhoneNumberUtil::getAsYouTypeFormatter(). * After that, digits can be added by invoking inputDigit() on the formatter instance, and the partially * formatted phone number will be returned each time a digit is added. clear() can be invokved before * formatting a new number. */ class AsYouTypeFormatter { /** * @var string */ private $currentOutput; /** * @var string */ private $formattingTemplate; /** * The pattern from numberFormat that is currently used to create formattingTemplate. * @var string */ private $currentFormattingPattern; /** * @var string */ private $accruedInput;이 라이브러리는 전화번호 데이터베이스를 처리할 수 있습니다.
<?php namespace Hashids; class Hashids implements HashidsInterface { const SEP_DIV = 3.5; const GUARD_DIV = 12; /** * The alphabet string. * * @var string */ protected $alphabet; /** * The seps string. * * @var string */ protected $seps = 'cfhistuCFHISTU'; /** * The guards string. * * @var string */ protected $guards;이 라이브러리는 정수로 고유한 문자열을 생성할 수 있는 암호화 라이브러리로, 사용자 ID 및 기타 목적을 숨길 수 있습니다.
<?php namespace Nocarrier; class Hal { protected $uri; protected $data; protected $resources = array(); protected $links = null; protected $arrayLinkRels = array(); protected $arrayResourceRels = array(); protected $shouldStripAttributes = true;HAL 라이브러리의 구조는 각 주변 장치를 ppp_HandleTypeDef라는 구조로 추상화합니다. 여기서 ppp는 각 주변 장치의 이름입니다. 모든 함수는 ppp_HandleTypeDef 포인터 아래에서 작동합니다. 1. 다중 인스턴스 지원: 각 주변 장치/모듈 인스턴스에는 자체 핸들이 있습니다. 따라서 인스턴스 리소스는 독립적입니다. 2. 주변 프로세스는 서로 통신합니다. 이 핸들은 프로세스 루틴 간의 공유 데이터 리소스를 관리하는 데 사용됩니다.
<?php require 'vendor/autoload.php'; use Filterus\Filter; $filter = Filter::map(array('foo' => 'string,min:4,default:test')); $tmp = array('foo' => 'bar'); var_dump(Filter::factory($filter)->filter($tmp)); //var_dump(Filter::factory($argv[1])->validate($argv[2]));PHP 필터는 사용자 입력과 같은 비보안 소스의 데이터를 검증하고 필터링하는 데 사용됩니다. PHP 필터란 무엇인가요? PHP 필터는 안전하지 않은 소스의 데이터를 검증하고 필터링하는 데 사용됩니다. 사용자 입력 또는 사용자 정의 데이터를 검증하고 필터링하는 것은 모든 웹 애플리케이션에서 중요한 부분입니다. PHP용 필터 확장은 데이터 필터링을 더 쉽고 빠르게 만들기 위해 설계되었습니다. 필터를 사용하는 이유는 무엇인가요? 거의 모든 웹 애플리케이션은 외부 입력에 의존합니다. 이 데이터는 일반적으로 사용자 또는 기타 애플리케이션(예: 웹 서비스)에서 제공됩니다. 필터를 사용하면 애플리케이션이 올바른 입력 유형을 얻도록 할 수 있습니다. 외부 데이터는 항상 필터링해야 합니다!