ホームページ > ダウンロード >  クラスライブラリのダウンロード

  • <?php interface IHuman {   function GetName(); } class ManClass implements IHuman {   public function GetName()   {     return "I'm man."."<br>";   } } class WomanClass implements IHuman {   public function GetName()   {     return "I'm Woman."."<br>";   } }オブジェクト指向プログラミングで最も一般的な方法は、オブジェクト インスタンスを生成する new 演算子であり、new 演算子はオブジェクト インスタンスの構築に使用されます。ただし、場合によっては、新しいオペレーターがオブジェクトを直接生成すると、問題が発生することがあります。たとえば、多くのタイプのオブジェクトを作成するには、一連の手順が必要です: オブジェクトの初期設定を計算または取得する必要がある場合があります。生成するサブオブジェクト インスタンスを選択するか、必要なオブジェクトを生成する前にいくつかのヘルパー オブジェクトを生成する必要があります。 。このような場合、新しいオブジェクトの作成は、より大型の機械のギア トランスミッションのような単なる操作ではなく、「プロセス」です。

    その他の図書館22902018-01-08
  • <?php   public function setEncode($incode,$outcode){     $this->inEncode=$incode;     $this->outEncode=$outcode;   }   public function setTitle($titlearr){     $title="";     foreach($titlearr as $v){       if($this->inEncode!=$this->outEncode){         $title.=iconv($this->inEncode,$this->outEncode,$v)."\t";       }       else{         $title.=$v."\t";       }     }     $title.="\n";     return $title;   }使用方法$excel=new Excel();エンコードの設定:$excel->setEncode("utf-8" ,"gb2312"); //トランスコードしたくない場合は、同じパラメータを記述するだけです (例: $excel->setEncode("utf-8","utf-8");#) #設定タイトル バー$titlearr=array("a","b","c","d");コンテンツ バーを設定する$contentarr=array(1=>array("ab","ac","ad","ae"),2 =>array( "abc","acc","adc","aec"),3=>array("abd","acd","add","aed") ,4=>array("abe","ace","ade","aee"), ); $excel->getExcel ($titlearr,$ contentarr,"abc");

    その他の図書館29032018-01-08
  • <?php class Foo {   const BAR = 'bar';   public static function getConstantValue()   {     return self::BAR;   }   public function getConstant()   {     return self::BAR;   } } $foo = 'Foo'; echo $foo::BAR, '<br />'; echo Foo::BAR, '<br />'; $obj = new Foo(); echo $obj->getConstant(), '<br />'; echo $obj->getConstantValue(), '<br />'; echo Foo::getConstantValue(); class Bar extends Foo {   const BAR = 'foo';    public static function getMyConstant()   {     return self::BAR;   }   public static function getParentConstant()   {     return parent::BAR;   } } echo Bar::getMyConstant(); // foo echo Bar::getParentConstant(); // barクラス定数はオブジェクト インスタンスではなくクラス自体に属し、オブジェクト インスタンスを通じてアクセスすることはできませんpublic、protected、private、static で変更することはできませんサブクラスはオーバーライドできます親クラス 親クラスの定数は、(parent::) を通じて呼び出すことができます。PHP5.3.0 以降、変数を使用してクラスを動的に呼び出すことができます。ただし、この変数の値をキーワード にすることはできません。

    その他の図書館22382018-01-08
  • <?php class time{   private $year;//年   private $month;//月   private $day;//天   private $hour;//小时   private $minute;//分钟   private $second;//秒   private $weekday;//星期   private $longDate;//完整的时间格式   private $diffTime;//两个时间的差值   //返回年份 time:时间格式为时间戳  2016-8-27   function getyear($time="",$type=""){     if($time==""){       $time=time();     }     if($type==1){       return $this->year=date("y",$time); //返回两位的年份 16     }else{       return $this->year=date("Y",$time); //返回四位的年份 2016     }   }   //返回当前时间的月份 time:时间格式为时间戳 2016-8-27   function getmonth($time="",$type=""){     if($time==""){       $time=time();     } PHP 時間クラスの完全な例。日付、時刻、曜日などを取得および比較するための PHP のさまざまな操作テクニックが含まれています。これは非常にシンプルで実用的です。必要な友人はこれを参照して、誰もが学習しやすくすることができます。 PHPコードを体験してください。

    その他の図書館32352018-01-06
  • <?php header("Content-Type: text/html; charset=UTF-8"); require("phpQuery.php"); $hj = QueryList::Query('http://mobile.csdn.net/',array("title"=>array('.unit h1','text'))); //dump($hj->data); $data = QueryList::Query('http://cms.querylist.cc/bizhi/453.html',array(     'image' => array('img','src')     ))->data; // $data = QueryList::Query('http://cms.querylist.cc/google/list_1.html',array(     'link' => array('a','href')     ))->data; $page = 'http://cms.querylist.cc/news/566.html'; $reg = array(     'title' => array('h1','text'),     'date' => array('.pt_info','text','-span -a',function($content){         $arr = explode(' ',$content);         return $arr[0];     }),     'content' => array('.post_content','html','a -.content_copyright -script',function($content){                   $doc = phpQuery::newDocumentHTML($content);             $imgs = pq($doc)->find('img');             foreach ($imgs as $img) {                 $src = 'http://cms.querylist.cc'.pq($img)->attr('src');                 $localSrc = 'w/'.md5($src).'.jpg';                 $stream = file_get_contents($src);                 file_put_contents($localSrc,$stream);                 pq($img)->attr('src',$localSrc);             }             return $doc->htmlOuter();     })     ); $rang = '.content'; $ql = QueryList::Query($page,$reg,$rang); $data = $ql->getData(); dump($data); は、Web サイトのクロールとクローリングをサポートしています。非常に強力です。これは、PHP に基づいたサーバー側のオープン ソース プロジェクトです。PHP 開発者は、ニュース Web サイトのヘッドライン情報の取得など、DOM ドキュメント コンテンツを簡単に処理できます。さらに興味深いのは、jQuery の考え方を使用していることで、jQuery を使用するのと同じようにページのコンテンツを処理して、必要なページ情報を取得することができます。

    その他の図書館38772018-01-06
  • <?php header("Content-Type:text/html; charset=utf-8"); define('APP_ROOT', str_replace('\', '/', dirname(__FILE__))); function get_tags_arr($title)     { require(APP_ROOT.'/pscws4.class.php');         $pscws = new PSCWS4(); $pscws->set_dict(APP_ROOT.'/scws/dict.utf8.xdb'); $pscws->set_rule(APP_ROOT.'/scws/rules.utf8.ini'); $pscws->set_ignore(true); $pscws->send_text($title); $words = $pscws->get_tops(5); $tags = array(); foreach ($words as $val) {    $tags[] = $val['word']; } $pscws->close(); return $tags; } print_r(get_tags_arr($con)); function get_keywords_str($content){ require(APP_ROOT.'/phpanalysis.class.php'); PhpAnalysis::$loadInit = false; $pa = new PhpAnalysis('utf-8', 'utf-8', false); $pa->LoadDict(); $pa->SetSource($content); $pa->StartAnalysis( false ); $tags = $pa->GetFinallyResult(); return $tags; } print(get_keywords_str($con));拡張機能のインストール不要、辞書付きで使いやすい多くの人が使い慣れているscwsともう1つはIT Plato社のphpanalyzeを使用インデックスを参照してください.php ファイルの使用例

    その他の図書館26492018-01-06
  • <?php class Cart {   //物品id及名称规则,调试信息控制   private $product_id_rule = '\.a-z0-9-_'; //小写字母 | 数字 | ._-   private $product_name_rule = '\.\:a-z0-9-_';//小写字母 | 数字 | ._-:   private $debug = TRUE;   private $_cart_contents = array();   public function __construct() {     //是否第一次使用?     if(isset($_SESSION['cart_contents'])) {       $this->_cart_contents = $_SESSION['cart_contents'];     } else {       $this->_cart_contents['cart_total'] = 0;       $this->_cart_contents['total_items'] = 0;     }     if($this->debug === TRUE) {       //$this->_log("cart_create_success");     }   }PHP のショッピング カート クラス ライブラリでは、主に PHP で実装されたショッピング カート クラスを紹介しており、ショッピング カートの基本的な追加、削除、統計およびその他の関連機能を実現できます。 : 1) ショッピングカートに商品を追加 2) ショッピングカートから商品を削除 3) ショッピングカートの商品情報を更新 [1/-1] 4) ショッピングカートの商品の統計 1. アイテムの合計 2. 数量の合計 3. 合計金額 5) 統計単一ショッピングアイテムの数量と金額の統計 6) ショッピングをクリアする

    その他の図書館23992018-01-06
  • <?php class ftp {   public $off;             // 返回操作状态(成功/失败)   public $conn_id;           // FTP连接   function __construct($FTP_HOST,$FTP_PORT,$FTP_USER,$FTP_PASS)   {     $this->conn_id = @ftp_connect($FTP_HOST,$FTP_PORT) or die("FTP服务器连接失败");     @ftp_login($this->conn_id,$FTP_USER,$FTP_PASS) or die("FTP服务器登陆失败");     @ftp_pasv($this->conn_id,1); // 打开被动模拟   }   function up_file($path,$newpath,$type=true)   {     if($type) $this->dir_mkdirs($newpath);     $this->off = @ftp_put($this->conn_id,$newpath,$path,FTP_BINARY);     if(!$this->off) echo "文件上传失败,请检查权限及路径是否正确!";   }メソッド: FTP 接続@FTP_HOST -- FTP ホスト@FTP_PORT --ポート@FTP_USER --ユーザー名@ FTP_PASS -- パスワード

    その他の図書館21792018-01-06
  • <?php namespace Moontoast\Math; class BigNumberTest extends \PHPUnit_Framework_TestCase {     protected function setUp()     {         ini_set('bcmath.scale', 0);     }     /**      * @covers Moontoast\Math\BigNumber::__construct      * @covers Moontoast\Math\BigNumber::getValue      * @covers Moontoast\Math\BigNumber::getScale      * @covers Moontoast\Math\BigNumber::setValue      * @covers Moontoast\Math\BigNumber::filterNumber      * @covers Moontoast\Math\BigNumber::setDefaultScale      */     public function testConstruct()     {         $bn1 = new BigNumber('9,223,372,036,854,775,808');         $this->assertSame('9223372036854775808', $bn1->getValue());         $this->assertEquals(0, $bn1->getScale());         $bn2 = new BigNumber(2147483647);         $this->assertSame('2147483647', $bn2->getValue());         $this->assertEquals(0, $bn2->getScale());これは非常に大きな数値を処理するための PHP ライブラリです。必要な友人はダウンロードして使用してください。

    その他の図書館25842018-01-05
  • <?php require_once __DIR__.'/../vendor/autoload.php'; use HeyUpdate\Emoji\UnicodeUtil; $configFile = __DIR__.'/../config/index.json'; $template = <<<'TEMPLATE namespace HeyUpdate\Emoji\Index; class CompiledIndex extends BaseIndex {     protected $emojis = {{emojis}};     protected $emojiUnicodes = {{emojiUnicodes}};     /**      * @var array      */     protected $emojiNames = {{emojiNames}};     /**      * @var string      */     protected $emojiUnicodeRegex = {{emojiUnicodeRegex}};     /**      * @var string      */     protected $emojiNameRegex = {{emojiNameRegex}}; }これは絵文字を処理するための PHP クラス ライブラリです。必要な友達はダウンロードして使用してください。

    その他の図書館21682018-01-05
  • <?php namespace SensioLabs\AnsiConverter\Tests; use SensioLabs\AnsiConverter\AnsiToHtmlConverter; class AnsiToHtmlConverterTest extends \PHPUnit_Framework_TestCase {     public function testConvert($expected, $input)     {         $converter = new AnsiToHtmlConverter();         $this->assertEquals($expected, $converter->convert($input));     }     public function getConvertData()     {         return array(             // text is escaped             array('<span style="background-color: black; color: white">foo <br /></span>', 'foo <br />'),             // newlines are preserved             array("<span style=\"background-color: black; color: white\">foo\nbar</span>", "foo\nbar"),             // backspaces             array('<span style="background-color: black; color: white">foo   </span>', "foobar\x08\x08\x08   "),これは ANSI を HTML5 に変換する php クラス ライブラリです。必要な友人はダウンロードして使用できます。

    その他の図書館21172018-01-05
  • <?php header('Content-type: text/plain; charset=UTF-8'); $in = file_get_contents('emoji-data/emoji.json'); $catalog = json_decode($in, true); echo file_get_contents('inc.css'); $max = 0; foreach ($catalog as $item){ $max = max($item['sheet_x'], $max); $max = max($item['sheet_y'], $max); } $fact = 100 / $max; $sheet_size = $max + 1; echo "span.emoji-inner { background-size: {$sheet_size}00%; }\n"; foreach ($catalog as $item){ $unilow = unicode_hex_chars($item['unified']); $pos_x = $item['sheet_x'] * $fact; $pos_y = $item['sheet_y'] * $fact; echo ".emoji$unilow { background-position: {$pos_x}% {$pos_y}% !important; }\n"; } function unicode_hex_chars($str){ $out = ''; $cps = explode('-', $str); foreach ($cps as $cp){これは絵文字表現変換 PHP クラス ライブラリです。必要な友達はダウンロードして使用できます

    その他の図書館23342018-01-05