国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? PHP ????? YII yii2? ???? QR ??? ???? ?? ??

yii2? ???? QR ??? ???? ?? ??

Mar 15, 2021 am 10:22 AM
yii2 QR ??

yii2? ???? QR ??? ???? ?? ??

QR??? ???? ???? ??? ??? ????.

1. ?? ?????? ??? ?????? ???????.

?? ?????? ??? ?????? ????? ?, ?? PHP ??? GD2? ????? ?????. ?? ?? phpqrcode.php? ???? ???. QR ??? ???????.

phpqrcode.php?

  • ???? $text? ? ?? ?? ???? ??? ???? ?? png() ???? ?????.

  • ???? $outfile? QR ?? ??? ?? ?? ??? ?????. , ???? no???.

  • $level ????? ???? ??? ?????. ?, ?? ??? ?? ??? ? ??? ?? L(QR_ECLEVEL_L, 7%), M(QR_ECLEVEL_M, 15%), Q???. (QR_ECLEVEL_Q, 25%), H (QR_ECLEVEL_H, 30%)

  • ???? $size? ??? ???? ??? ????, ???? 3???. QR ?? ??? ???

  • ???? $saveandprint? QR ?? ?? ??? ???? ?????.

2. ???? ? ??? ? phpqrcode ??? ??? ?? ?? ??? ????.

yii2? ???? QR ??? ???? ?? ??

3.

Yii::$enableIncludePath = false;
Yii::import ('application.extensions.phpqrcode.phpqrcode', 1 );

4 ???? ?????.

public function actionQrcode(){
        $this->breadcrumbs=array_merge($this->breadcrumbs,array(
                '生成二維碼'
        ));
        $qrcode_path='';
        $file_tmp_name='';
        $errors=array();
        if(!empty($_POST)){
            $content = trim($_POST['content']); //二維碼內(nèi)容
            $contentSize=$this->getStringLength($content);
            if($contentSize>290){
                $errors[]='字?jǐn)?shù)過長(zhǎng),不能多于150個(gè)字符!';
            }
            Yii::$enableIncludePath = false;
            Yii::import ('application.extensions.phpqrcode.phpqrcode', 1 );
            if(isset($_FILES['upimage']['tmp_name']) && $_FILES['upimage']['tmp_name'] && is_uploaded_file($_FILES['upimage']['tmp_name'])){
                if($_FILES['upimage']['size']>512000){
                    $errors[]="你上傳的文件過大,最大不能超過500K。";
                }
                $file_tmp_name=$_FILES['upimage']['tmp_name'];
                $fileext = array("image/pjpeg","image/jpeg","image/gif","image/x-png","image/png");
                if(!in_array($_FILES['upimage']['type'],$fileext)){
                    $errors[]="你上傳的文件格式不正確,僅支持 png, jpg, gif格式。";
                }
            }
            $tpgs=$_POST['tpgs'];//圖片格式
            $bas_path=dirname ( Yii::app ()->BasePath );
            $qrcode_bas_path=$bas_path.'/upload/qrcode/';
            if(!is_dir($qrcode_bas_path)){
                mkdir($qrcode_bas_path, 0777, true);
            }
            $uniqid_rand=date("Ymdhis").uniqid(). rand(1,1000);
            $qrcode_path=$qrcode_bas_path.$uniqid_rand. "_1.".$tpgs;
            $qrcode_path_new=$qrcode_bas_path.$uniqid_rand."_2.".$tpgs;
            if(Helper::getOS()=='Linux'){

                $mv = move_uploaded_file($file_tmp_name, $qrcode_path);
            }else{
                //解決windows下中文文件名亂碼的問題
                $save_path = Helper::safeEncoding($qrcode_path,'GB2312');
                if(!$save_path){
                    $errors[]='上傳失敗,請(qǐng)重試!';
                }
                $mv = move_uploaded_file($file_tmp_name, $qrcode_path);
            }
            if(empty($errors)){
                $errorCorrectionLevel = $_POST['errorCorrectionLevel'];//容錯(cuò)級(jí)別
                $matrixPointSize = $_POST['matrixPointSize'];//生成圖片大小
                $matrixMarginSize = $_POST['matrixMarginSize'];//邊距大小
                //生成二維碼圖片
                QRcode::png($content,$qrcode_path_new, $errorCorrectionLevel, $matrixPointSize, $matrixMarginSize);
                $QR = $qrcode_path_new;//已經(jīng)生成的原始二維碼圖
                $logo = $qrcode_path;//準(zhǔn)備好的logo圖片
                if (file_exists($logo)) {
                    $QR = imagecreatefromstring(file_get_contents($QR));
                    $logo = imagecreatefromstring(file_get_contents($logo));
                    $QR_width = imagesx($QR);//二維碼圖片寬度
                    $QR_height = imagesy($QR);//二維碼圖片高度
                    $logo_width = imagesx($logo);//logo圖片寬度
                    $logo_height = imagesy($logo);//logo圖片高度
                    $logo_qr_width = $QR_width / 5;
                    $scale = $logo_width/$logo_qr_width;
                    $logo_qr_height = $logo_height/$scale;
                    $from_width = ($QR_width - $logo_qr_width) / 2;
                    //重新組合圖片并調(diào)整大小
                    imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width,
                    $logo_qr_height, $logo_width, $logo_height);
                    //輸出圖片
//                     header("Content-type: image/png");
                    imagepng($QR,$qrcode_path);
                    imagedestroy($QR);
                }else{
                    $qrcode_path=$qrcode_path_new;
                }
                $qrcode_path=str_replace($bas_path,'', $qrcode_path);
            }else{
                $qrcode_path='';
            }
        }
        $data=array('data'=>array('errors'=>$errors,'qrcode_path'=>$qrcode_path));
        $this->render ( 'qrcode',$data);
    }

?? ??? ???? ??. ??? ????

4 ??? ???? ??? ?????

<?php
$vars = get_defined_vars ();
$data = $vars [&#39;data&#39;];
$content=Yii::app ()->request->hostInfo;
$matrixPointSize=6;
$matrixMarginSize=2;
$errorCorrectionLevel=&#39;M&#39;;
$tpgs=&#39;gif&#39;;
if(!empty($_POST)){
    $content=$_POST[&#39;content&#39;];
    $matrixPointSize=$_POST[&#39;matrixPointSize&#39;];
    $matrixMarginSize=$_POST[&#39;matrixMarginSize&#39;];
    $errorCorrectionLevel=$_POST[&#39;errorCorrectionLevel&#39;];
    $tpgs=$_POST[&#39;tpgs&#39;];
}
$arrayCorrectionLevel=array(&#39;L&#39;=>&#39;L - Low (7%)&#39;,&#39;M&#39;=>&#39;M - Medium (15%)&#39;,&#39;Q&#39;=>&#39;Q - Quartile (25%)&#39;,&#39;H&#39;=>&#39;H - High (30%)&#39;);
$arrayTpgs=array(&#39;gif&#39;=>&#39;gif格式&#39;,&#39;png&#39;=>&#39;png格式&#39;,&#39;jpg格式&#39;);
?>
<div class="col-md-12">
    <div class="form-horizontal panel panel-default margin-t-10 b-img">
        <div class="panel-heading">
            <div class="pull-left">
                <span class="g-bg glyphicon glyphicon-wrench margin-r-2"
                    aria-hidden="true"></span>在線生成二維碼
            </div>
            <div class="clearfix"></div>
        </div>
<?php
$form = $this->beginWidget ( &#39;CActiveForm&#39;, array (
        &#39;id&#39; => &#39;qrcode-form&#39;,
        &#39;htmlOptions&#39; => array (
                &#39;id&#39; => &#39;view_table&#39;,
                &#39;class&#39; => &#39;add-form padding-10&#39;,
                &#39;enctype&#39; => &#39;multipart/form-data&#39;
        ),
        &#39;enableAjaxValidation&#39; => false
) );
?>
    <div class="form-group">
            <label class="col-lg-2 control-label">尺寸大小</label>
            <div class="col-lg-3">
                <select class="form-control" id="matrixPointSize"
                    name="matrixPointSize">
                    <?php for ($i=1;$i<21;$i++):?>
    <option value="<?php echo $i;?>" <?php echo $i==$matrixPointSize?&#39;selected&#39;:&#39;&#39;;?>><?php echo $i;?></option>
                    <?php endfor;?>
                    </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-2 control-label">邊距大小</label>
            <div class="col-lg-3">
                <select class="form-control" id="matrixMarginSize"
                    name="matrixMarginSize">
                    <?php for ($i=0;$i<21;$i++):?>
    <option value="<?php echo $i;?>" <?php echo $i==$matrixMarginSize?&#39;selected&#39;:&#39;&#39;;?>><?php echo $i;?></option>
                    <?php endfor;?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-2 control-label">容錯(cuò)級(jí)別</label>
            <div class="col-lg-3">
            <?php echo CHtml::dropDownList(&#39;errorCorrectionLevel&#39;,$errorCorrectionLevel, $arrayCorrectionLevel,array(&#39;class&#39;=>&#39;form-control&#39;));?>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-2 control-label">保存格式</label>
            <div class="col-lg-3">
            <?php echo CHtml::dropDownList(&#39;tpgs&#39;,$tpgs, $arrayTpgs,array(&#39;class&#39;=>&#39;form-control&#39;));?>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-2 control-label">二維碼內(nèi)容</label>
            <div class="col-lg-5">
                <?php echo CHtml::textField(&#39;content&#39;,$content,array(&#39;class&#39;=>&#39;form-control&#39;,&#39;maxlength&#39;=>150));?>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-2 control-label">二維碼logo圖片</label>
            <div class="col-lg-5">
                <div class="col-md-6">
                        <input id="upimage" type="file" name="upimage" class="hidden">
                        <input id="tmp_file" class="form-control" type="text" value="gif,png,jpg">
                    </div>
                <div class="col-md-6"><a class="btn btn-default" onclick="$(&#39;input[id=upimage]&#39;).click();">選擇文件</a></div>
            </div>
        </div>
        <div class="list_back">
            <input type="submit" value="生成二維碼" class="btn btn-success">
        </div>
    </div>
<?php $this->endWidget(); ?>
    <div class="panel panel-default margin-t-10 b-img">
        <div class="panel-heading">
            <span class="g-bg glyphicon glyphicon-wrench margin-r-2" aria-hidden="true"></span>二維碼
        </div>
        <div class="panel-body">
        <?php if(empty($_POST)):?>
        <?php echo CHtml::image(&#39;/static/tool/qrcode/qrcode.gif&#39;,&#39;二維碼&#39;);?>
        <?php endif;?>
        <?php if(!empty($data[&#39;errors&#39;])):?>
            <label class="col-lg-2 text-right">生成失敗</label>
            <div class="col-lg-5">
            <?php foreach ($data[&#39;errors&#39;] as $e):?>
            <?php echo $e;?><br>
            <?php endforeach;?>
            </div>
        <?php endif;?>
        <?php if(!empty($data[&#39;qrcode_path&#39;])):?>
            <?php echo CHtml::image($data[&#39;qrcode_path&#39;],&#39;二維碼&#39;);?>
            <a class="btn btn-success color-f" href="<?php echo $data[&#39;qrcode_path&#39;];?>" target="_blank"><span aria-hidden="true" class="glyphicon glyphicon-download-alt margin-r-2"></span>右鍵另存為二維碼</a>
        <?php endif;?>
        </div>
    </div>
<?php $this->renderPartial(&#39;/component/duoshuo_common&#39;);?>
</div>
?? ??? ??? ????:


yii2? ???? QR ??? ???? ?? ??

?? ?? ??:

yii ?????

? ??? yii2? ???? QR ??? ???? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
wps? ???? QR ??? ??? ?? wps? ???? QR ??? ??? ?? Mar 28, 2024 am 09:41 AM

1. ?????? ?? wps ??? ?? ?????? ?????. 2. ? ??????? ?? ??? ????. 3. ?? ??? ???? ?? ?? ???? QR ?? ??? ????. 4. QR ?? ??? ???? QR ?? ?? ??? ?????. 5. ??? ??? ??? ???? ??? ??? ??? ?????. 6. ?????? QR??? ??? ??? ??? ? ????.

PHP? ???? QR ??? ???? ???? ?? PHP? ???? QR ??? ???? ???? ?? Sep 05, 2023 pm 05:45 PM

PHP? ???? QR ??? ???? ???? ?? QR ??(QR ??)? ?? ?? ??? ??? ? ?? ???? ????. ? ????????? ????? ??? ??? ???? ?? QR ??? ???? ???? ?? ??? ????. ? ????? PHP? ???? QR ??? ???? ???? ??? ?????. 1. QR ?? ??? ???? ?? ?? PHPQRCode ?????? ???? ?????. ??, ??? ?????

iPhone?? QR ??? ???? ?? iPhone?? QR ??? ???? ?? May 04, 2023 am 11:46 AM

?? ??: iPhone?? QR ?? ?? ??? QR ?? ?? ??? iOS 11? ???? ?? iPhone?? ????? ????? ????. ??? ????? QR ??? ??? ? ???? iPhone? ?? ??? ?? ??(?? iOS11)?? ?????? ??? ???? ???. ?? ??? ???? ?? iPhone?? ?? ??? ????? ??? ???? ???. ?? ?? ?? ??? ??? ?? iPhone?? QR ?? ??? ???? ? ????. ?? ???? 'QR ?? ??' ??? ??????. ?? ?? ? ??? ???? QR ??? ???? ??? ? ??? ??? ??? ???.

Enterprise WeChat? QR ??? ??? ? ??? ??? ?? ???? Enterprise WeChat? QR ??? ??? ? ??? ??? ?? ???? Mar 14, 2024 pm 10:46 PM

Enterprise WeChat? QR ??? ??? ? ??? ??? ?? ???? Enterprise WeChat? ??? ??? ???? ? QR ??? ??? ? ?? ??? ? ?? ?? ??? ?? ???? ??? ???? Enterprise? QR ??? ???? ??? ?? ?? ??? ??? ?????. WeChat? ??? ? ????. ??? ??? ??? ?? ?????! ?? 1. ???? ?? 1. ???? ??? ?? ??? ???? ??? ?? ?? ? ????. ??? ???? ?? ??? ???. 2. ??? ??? ???? ??? ???? ????? ???? ??? ?????. ???? ??? ?? ??? ? ????. ?? 2: ?? ?? ? ????: Enterprise WeChat ??? ?? ??? QR ??? ???? ?? ? ????. ?????? ?? ???? ?????? ? ????. ?? 3, ??? 1

PHP? ???? ?? QR ??? ???? ??? ?????? PHP? ???? ?? QR ??? ???? ??? ?????? Aug 25, 2023 pm 04:33 PM

PHP? ???? ?? QR ??? ???? ??? ?????? ??? ??? ???? ???? QR ??? ?? ???? ?? ?? ??? ?????. QR??? ?? ?? ??? ??? ? ??, ??? ???? ??? ? ?? ??? ?? ???? ?? ???? ????. ?? ??, ??? ?? ? ??? QR ??? ?? ???? ?? ??? ????. PHP? ? ??? ?? ???? ???? ???? ???? ???? ???? ????. ????? PHP? ???? ???? ??? ?????.

PHP? ???? ?? ??? ?? QR ??? ???? ??? ?????? PHP? ???? ?? ??? ?? QR ??? ???? ??? ?????? Aug 26, 2023 pm 04:34 PM

PHP? ???? ?? ??? ?? QR ??? ???? ??? ?????? ??? ??? ????? ???? QR??? ???? ??? ?????. ?? ?????? ?? ??? ?? QR ??? ???? ? ? ???, ?? ?? ??? ??? ???? ????. ? ????? PHP? ???? ?? ??? ?? QR ??? ???? ??? ???? ??? ?? ??? ?????. PHPQRCode ????? ?? PHP? ???? QR ??? ????? ?? PHPQRCode ?????? ???? ???. ? ???

PHP? ?? ??? QR ?? ???? ???? ?? PHP? ?? ??? QR ?? ???? ???? ?? Sep 24, 2023 am 08:49 AM

PHP? ?? ??? QR ?? ???? ???? ?? QR ??? ?? ???? ?? ??????? ??? ??? ???? ??? ??? ???? ? ????. ? ????? PHP? ???? ??? QR ?? ???? ???? ??? ???????. 1. ??? ??? ????? ?? ???? ?? ?? ??? ?????? ???? ??? ???? ???. PHP: ?? ??? PHP? ???? ??? ?????. php? ???? ?? PHP ??? ??? ? ????. -v ??. ??:C

Vue? ???? QR ??? ???? ?? Vue? ???? QR ??? ???? ?? Nov 07, 2023 am 09:57 AM

QR ??? ?? ???? ?? ???? ?? ??? ?????. Vue? ???? QR ??? ???? ??? ?????? 1. QR ?? ?? ??? ?????. QR ?? ?? ??? ??? ?? URL ??? ???? ???? ?? ??? ?? URL ??? ??? ????? ????. ?? ?????? ???? QR ??? ??? ? ????. ? ????? Qrcode.js ?????? ???? QR ??? ???? ??? ?????. Qrcode.js? ??? ???? ?? QR ?? ?? ????????. ?

See all articles