Hongmu Notes
Home Language Notes

Language Notes

Detailed description of php $_SERVER

Detailed description of php $_SERVER Language Notes PHP

$_SERVER['SCRIPT_NAME'] //当前脚本的路径dirname($_SERVER['SCRIPT_NAME'] // dirname() returns the directory portion of a path; $_SERVER['SCRIPT_FILENAME'] // The absolute path of the currently executing script...
👁 151
css background image is fixed and does not scroll (background

css background image is fixed and does not scroll (background Language Notes CSS

background-attachment attribute body { background-image:url('smiley.gif'); background-repeat:no-repeat; background-attachment:fixed; } Tag definition and usage instructions background-atta…
👁 210
Click to expand the menu js code on the mobile side

Click to expand the menu js code on the mobile side Language Notes JavaScript

HTML code: <div class= "menu" > <i></i> <i></i> <i></i> </div> CSS code:.hdCon.menu {width: 40px; border...
👁 174
php gzcompress() and gzuncompress() functions implement string compression

php gzcompress() and gzuncompress() functions implement string compression Language Notes PHP

:(Comical) When we talk about compression, we might think of file compression; however, strings can also be compressed. PHP provides the `gzcompress()` and `gzuncompress()` functions: `$string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nu...";`
👁 110
PHP glob() function

PHP glob() function Language Notes PHP

Definition and Usage: The `glob()` function returns the filenames or directory names that match a specified pattern. This function returns an array containing the matched filenames or directory names; if an error occurs, it returns `false`. Syntax: `glob(pattern, flags)`. Parameters: - `pattern`: Required. Specifies the search pattern. - `flags`: Optional. Specifies special options. Example: Example 1: `<?php print_r(glob('*.php'));`
👁 128
Example of how to obtain the top-level domain name in the URL address using PHP

Example of how to obtain the top-level domain name in the URL address using PHP Language Notes PHP

This article demonstrates an example of how to use PHP to extract the top-level domain (TLD) from a URL. We share this code for your reference; the implementation is as follows: The `parse_url()` function returns the host portion of a URL, which may contain multiple-level domains (e.g., `mp.weixin.qq.com`). When creating a domain blacklist, it is necessary to identify the top-level domain. If you find any shortcomings in this code, please leave a comment to point them out – thank you! <?php /** * @Author: Di...
👁 152
PHP iconv encoding conversion in file

PHP iconv encoding conversion in file Language Notes PHP

Convert UTF-8 to GBK $data = iconv(&quot;utf-8&quot;,&quot;GBK//IGNORE&quot;,$data); Convert GBK to UTF-8 $data = iconv(&quot;GBK&quot;,&quot;utf-8//IGNORE&quot;,$data); IG...
👁 176
Bootstrap5 container document translation

Bootstrap5 container document translation Language Notes Bootstrap

Containers are the fundamental building blocks of Bootstrap; they are used to contain, fill, and align content within a specific device or viewport. Containers are the most basic layout elements in Bootstrap and are essential when using our default grid system. They are used to hold, fill, and (sometimes) center content. While containers can be nested, most layouts do not require nested containers. Bootstrap comes with three types of containers...
👁 190
css3 2D animation (transform)

css3 2D animation (transform) Language Notes CSS

transform syntax: transform: none | <transform-function>+ transform-function list: matrix() = matrix(<number>[,<number>]{5,5}) matrix3d() =…
👁 161
css vh and vw adaptive

css vh and vw adaptive Language Notes CSS

In the mobile terminal, REM is used to change the root HTML, and the mobile terminal adaptation is realized through a piece of JS. This article uses pure CSS viewport units to self-adapt. Although the current compatibility is not fully acceptable, it does not prevent you from recognizing the power of vw and vh. The implementation of responsive layout relies on media queries (Media Queries). Select the width size of mainstream devices as breakpoints to target...
👁 356
1 26 27 28 29 30 33