PHP's several commonly used number judgment function code, mainly including double precision, integer, character judgment and so on.
Commonly used numerical judgment function
"); } Double-precision number judgment $Temperature = 15.23; if (
I write in PHP to generate membership account function, for reference only, the code is as follows:
function Get_number ($table, $filed) {if (!isset ($table) | |!isset ($filed)) {return ';} if (Trim ($table) = = ' | | Trim ($filed) = = ') {return ';
Personal-made site call Tags:
{if $menu _title eq '} {$web _config. w_st}{else}{$menu _title}{/if}
{if $web _config. W_GC eq ' 1 '}{literal} {/literal}{/if}
Articles you may be interested in
Summary of System
The gzip feature is a compression of the page size to speed up the opening of the Web page, the current mainstream browser almost all support this feature. This is a very useful and popular feature, but it requires server support to turn on gzip,
Copy CodeThe code is as follows:
Paging function First page: URL/1 second page: URL/2
function pages ($url, $totalnum, $page, $pagesize = 20) {
$urladd = ";
$url. = '/';
$totalpage = Ceil ($totalnum/$pagesize);
if ($totalpage $page = min
In the process of doing the project, you need to use the LIKE keyword to combine the query criteria, the following authors will use in the thinkphp like query to do share.
Here are the main examples of usage:
$userForm =m (' user ');
$where [' Name
Smarty Video tutorial Sharing, the following is the specific download address, the need for friends can see, the Smarty template explained very detailed, the author of a cursory look at the catalogue, is really detailed to the details of the drop,
This article mainly describes the PHP generation of custom-length random string function sharing, the need for friends can refer to the following
PHP randomly generated string can define its own length, in the actual application development, often
Most of the friends who do PHP development know that there is a ucenter can be used to achieve multiple sites at the same time to log out, the user synchronization function. The following author will be on how to achieve synchronization Ucenter and
Pagination display is one of the most frequently handled aspects of Web programming. The so-called paging display, is the result set by the program to display a paragraph. For paginated display, two initial parameters are required: How many records
Through this interface can query Yuantong Express, Shentong Express, EMS Express, Yun Tatsu Express, such as courier tracking information, no additional development, very convenient
First, register an account with www.aikuaidi.cn and use key!
Copy
The first common sense is that in the browser to execute the JS script, when there is a script error, and you do not manually do the exception capture, he will appear in the browser yellow exclamation mark, it is normal, this is not the most
The thinkphp template engine can directly output some system variables and system constants, as well as system special variables, without assigning values to a template variable. The output for the system variable must be $think. And can still
Interface
Defines an interface class in which the subclasses of a method must be implemented. An interface is a template for a class whose subclasses must implement all the methods defined in the interface.
Interface user{
function
first, the data cache
In this case, the data cache refers to the database query cache, each time the page is accessed, the corresponding cache data will be detected, if not, connect to the database, get the data, and the query results are
The header () function of PHP is used to define the encoding of a PHP page (note: There can be no output before, otherwise an error)
PHP page is UTF8 encoded: header ("content-type:text/html; Charset=utf-8 ");
PHP page is GBK encoded: header
PHP Merging arrays We can use the Array_merge () function, the Array_merge () function, to return an array of unions. The resulting array starts with the first input array parameter, appended in the order in which the array parameters appear later.
PHP function instance, based on regular expressions to determine the browser's default language, in fact, PHP judgment browser language using Super global variable _server["http_accept_language" can be obtained, And then according to the HTTP
Share the generated code for a short php URL.
Copy CodeThe code is as follows:
Urlshort
Header ("Content-type:text/html;charset=utf-8");
function base62 ($x) {
$show = ";
while ($x >0) {
$s = $x% 62;
if ($s > 35) {
$s = Chr
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service