Category:PHP

  • An example of a simple method for calculating weights in PHP [suitable for lottery applications]

    Time:2019-8-24

    In this paper, an example is given to illustrate the simple method of calculating weight in php. Share for your reference, as follows: // Simple Weight Calculator $data222=array( 0=> array (‘id’=> 1,’name’=>’first prize’,’weight’=>’3′), 1=> array (‘id’=> 2,’name’=>’second prize’,’weight’=>’1′), 2=> array (‘id’=> 3,’name’=>’third prize’,’weight’=>’5′), 3=> array (‘id’=> 3,’name’=>’third prize’,’weight’=>’1′), ); // The higher the weight value, […]

  • WordPress Method to Increase the Return Top Effect

    Time:2019-8-24

    This article gives an example of how WordPress can increase the effect of returning to the top. Share for your reference. The concrete realization method is as follows: Returning to the top effect is not a function of WordPress. It’s a JS or jQuery effect. Here’s how to increase the top effect in WordPress. Step […]

  • Larave uses composer to install no response, prompting “Changed current directory to C:/Users/Administrator/AppData/Roaming/Composer”

    Time:2019-8-24

    When installing Laravel on Windows in the way Laravel documents are installed, executecomposer global require “laravel/installer”。 Then the command line shows the Changed current directory to C:/Users/Administrator/AppData/Roaming/Composer, and it never responds; this is because the composer’s mirror download address can not be connected, just need to modify the composer’s mirror download address to be domestic, […]

  • PHP Converts Upload Word File to PDF [Based on COM Component]

    Time:2019-8-23

    This paper illustrates the method of converting PHP to upload word file into PDF. Share for your reference, as follows: In the past, I used office component to convert uploaded file word into HTML file at the same time. This time, I want to convert word file into PDF format. There are many methods on […]

  • Summary of methods for displaying articles by random calls to WordPress

    Time:2019-8-23

    This paper summarizes the method of displaying articles by random call of wordpress. Share for your reference. The specific methods are as follows: To display articles randomly in WordPress, three methods of calling random articles are introduced here. Friends in need can choose according to their own situation. Method 1: WordPress built-in functionCall the following […]

  • PHP multiprocess programming

    Time:2019-8-23

    Take a look at the PHP version I have installed PHP 7.3.7 (cli) (built: Jul 12 2019 22:25:55) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies To implement multi-process in php, we need to install the pcntl module, which is officially provided by php, so we […]

  • Example code of creating custom menu function for wechat public number in PHP

    Time:2019-8-22

    objective Create custom menus to implement menu events. First get Access_Token Interface: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET I use the test number, modify the APPID and APSECRET, and then the browser accesses the Url above to generate Access_Token. Then configure the menu event, caidan. PHP <?php header(“Content-type: text/html; charset=utf-8”); Define (“ACCESS_TOKEN”, “Generated Access_Token”); // Create menus function createMenu($data){ $ch […]

  • Implementation Method of Adding Voice Search Function to WordPress

    Time:2019-8-22

    This paper gives an example of how to add voice search function to WordPress. Share for your reference. Specific analysis is as follows: WordPress can add a voice search function, but this function can only be used in Chrome browser for the time being, because it must use x-webkit-speech, but it is also the API […]

  • State change of laravel framework

    Time:2019-8-22

    // [email protected]($v[‘sex’]==0)<td ss=”{$V [‘sex’]}” id=”{$V [‘id’]}”> male</td> @elseif($v[‘sex’]==1)<td ss=”{$V [‘sex’]}” id=”{$V [‘id’]}”> female</td>@endif//jqery $(document).on(“click”,”.se”,function () { id=$(this).attr(“id”); sex= $(this).attr(“ss”); str=””; if (sex==0){Str= “man” }else{Str= “female” } that=$(this); $.ajax({ url:”jdjg”, type:”post”, dataType:”json”, data:{ id:id, sex:str }, success:function (data) { console.log(data);If (data== “man”){That. text (“man”) that.attr(“ss”,0) } else{That. text (“female”) that.attr(“ss”,1) } } })})// Controller function jdjg(req […]

  • Usage Analysis of PHP Object-Oriented Programming _tostring() and _invoke()

    Time:2019-8-21

    This paper describes the usage of PHP object-oriented programming _tostring() and _invoke(). Share for your reference, as follows: __tostring()Magic Methods When an object is used as a string, this method is called automatically, and in this method, a certain string can be returned to indicate the result after the object is converted to a string. […]

  • WordPress’s Method of Sharing Selected Contents on Sina Tencent’s Weibo

    Time:2019-8-21

    This article gives an example of how WordPress shares the selected content on Sina Tencent Weibo. Share for your reference. The specific methods are as follows: 1. Introducing jQuery, I believe that most WordPress blogs have already introduced jQuery, so we can go straight to the second step. 2. At the bottom of the page, […]

  • Token Logon Authentication Based on JWT

    Time:2019-8-21

    1. Introduction to JWT       JSON Web Token (abbreviated as JWT) is the most popular cross-domain authentication solution at present. 2. Principle of JWT The principle of JWT is that after server authentication, an object in JSON format is generated and sent back to the client, as follows.   { “User name”: “admin” […]