Hongmu Notes
Commonly used regular expressions

Commonly used regular expressions Summary of pitfalls

Regular expression URL (URL) [a-zA-z]+://[^\s]*IP address (IP Address)((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?) Email (Email)\w+([-+.]\w+)*@\w+([-.]\w+)*…
👁 243
Methods of division and rounding in php (round, ceil, floor)

Methods of division and rounding in php (round, ceil, floor) Language Notes PHP

When the result of division needs to be rounded in PHP, the following methods are needed: 1. round: round () function rounds floating-point numbers. Syntax: round(x, prec) parameter description x is optional. Specifies the number to round. Prec is optional. Specify the number of digits after the decimal point. Description: Returns the number of x based on the specified precision prec (decimal decimal number …
👁 212
Remove Chinese from php string

Remove Chinese from php string Language Notes PHP

& lt; ? php $a = & quot; & lt; a& gt; The crab society afeowahgieawhjozf waits for the snake fawgwea to maintain stability aghoiawghowi &amp lt; /a& gt; & quot; ; $result = preg_replace(' /([\x80-\xff]*)/i' ,' ' ,$a); var_du…
👁 142
PHP gets all files in a folder and returns scandir() function as an array

PHP gets all files in a folder and returns scandir() function as an array Language Notes PHP

List the files and directories in the images directory:&; lt; ? php $dir = & quot; /images/& quot; ; $a = scandir($dir); $b = scandir($dir,1); print_r($a); print_r($b); ? & gt; Results: array ([0] =&; gt…
👁 126
Identification and understanding of php paths

Identification and understanding of php paths Language Notes PHP

The following are several special symbols used to establish the path and their meanings. "./":represents the current directory. "../":stands for the upper level directory. Start with "/":stands for root directory.
👁 119
How to set response headers in php

How to set response headers in php Language Notes PHP

Setting response headers in PHP: 1. Setting the response header for file types: `<?php header('Content-Type: text/css; charset=GBK'); // For CSS files, using GBK encoding; header('Content-Type: text/html; charset=UTF-8'); // For HTML files, using UTF-8 encoding...`
👁 131
Typecho theme development

Typecho theme development Program Notes Typecho

In Typecho’s official theme development documents, there are very few development instructions related to article custom fields and theme settings. I also looked at the code of some open source themes to understand the development of custom fields and theme settings. Here I will briefly write about the definition and invocation of article custom fields and theme settings. Article custom fields After the article custom fields are defined, they will be displayed below the edit box on the article editing interface. Users can use the defined options...
👁 845
Multiple methods for specifying whether a string is included in a php string

Multiple methods for specifying whether a string is included in a php string Language Notes PHP

The `str strstr()` function searches for the first occurrence of one string within another string. It returns the remaining part of the string (starting from the matching position); if the target string is not found, it returns `false`. The code is as follows: `<?php $email = 'user@example.com'; $domain = strstr($email,...`
👁 138
Browser caching increases the speed of secondary visits to your website

Browser caching increases the speed of secondary visits to your website Summary of pitfalls

Use browser caching of official words: If users will visit your website multiple times, browser caching of static resources can save users time. Cache headers should be applied to all cacheable static resources, not just to a small subset of static resources (for example, images). Cacheable resources include JS and CSS files, image files, and other binary object files (media files, PDF files, etc.). Normally, HTML doesn’t…
👁 202
Typecho determines whether the plug-in is activated

Typecho determines whether the plug-in is activated Program Notes Typecho

When making templates, you may need to use plug-ins in some places. Then you need to check whether the plug-in is enabled, you can use the following plug-in: <?php $all = Typecho_Plugin::export();?> <?php if (array_key_exists('plugin name', $all['activated'])) : …
👁 162
1 311 312 313 314 315

🔥 Popular articles

Empire CMS smart label call field collection

Empire CMS smart label call field collection Program Notes Empire cms

Collect and classify all fields that support smart tag calls into Empire CMS smart tags: [e:loop={column ID/topic ID, number of items displayed, operation type, only display pictures with titles, additional SQL conditions, display sorting}] Template code content [/e:loop] Calling time: <?=date('m-d',$bqr[newstime])?> <?=dat…
👁 3749
Imperial cms imitation website tutorial corresponding notes

Imperial cms imitation website tutorial corresponding notes Program Notes Empire cms

Hello everyone, welcome to learn the imperial cms imitation website tutorial. I am Hong Mu qq1810216796 QQ exchange group: 9589723231 Imperial cms website installation. Hello everyone, welcome to learn the imperial cms imitation website tutorial. I am Hong Mu qq: 1810216796 qq exchange group: 958972323 Build an imperial program. If you have a server and have built an imperial website on the server, then...
👁 3412
Empire cms7.5 payment upgraded and optimized version of the library sample automatically generates word/PDF documents paid copy download with payment system member center whole site template source code sitemap Baidu push + installation tutorial 014

Empire cms7.5 payment upgraded and optimized version of the library sample automatically generates word/PDF documents paid copy download with payment system member center whole site template source code sitemap Baidu push + installation tutorial 014 Practical Collection empire template

This set of templates has a complete member center on mobile and PC. The member center template is also very good! By the way, there are also corresponding locomotive collection rules! Regarding installation, upload the direct installation version, install it directly, and then restore the data in the background. There is a view more on the mobile phone. If there is a problem, you can copy the view more code in index.js on the PC. If it has not taken effect yet, please check whether the js file renderings are referenced...
👁 2691