<?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 クエリ ステートメントはその典型的な例であり、高度なクエリでも低レベル クエリでも、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" となり、s[0]=10 のように文字列のゼロの位置がその長さになります (※これにより、高精度演算時に各ビットを数値に変換して配列に格納できるなど、非常に便利になります。
<?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」の外国語略語ですが、この言語がマークアップ言語に重点を置くのではなくデータ中心であることを強調するために、基本に戻るという言葉で名前が変更されました。コンピュータが認識できる直感的なデータシリアル化形式であり、可読性が高く人間にとって読みやすいプログラミング言語であり、スクリプト言語との対話が容易であり、データシーケンスを表現するために使用されます。 これは、標準ユニバーサル マークアップ言語のサブセットである 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 進数「00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fcc f を変換してください」 695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462 db0a22b8e7' は 10 進数に変換されます。通常の hexdec() メソッドを使用してこのような大きな数値を解くと、結果は 1.5779475026713E 308 になります。 . データの精度が著しく低下します。そのため、大量の数値を処理するための math-master 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 フィルターは、安全でないソースからのデータを検証およびフィルターするために使用されます。 ユーザー入力またはカスタム データの検証とフィルタリングは、Web アプリケーションの重要な部分です。 PHP フィルター拡張機能は、データのフィルター処理を簡単かつ高速にするように設計されています。 なぜフィルターを使用するのでしょうか? ほぼすべての Web アプリケーションは外部入力に依存しています。通常、このデータはユーザーまたは他のアプリケーション (Web サービスなど) から取得されます。フィルターを使用すると、アプリケーションが正しい入力タイプを取得できるようになります。 外部データは常にフィルタリングする必要があります。