Hongmu Notes
Home Language Notes

Language Notes

PHP filectime() function

PHP filectime() function Language Notes PHP

Definition and Usage: The `filectime()` function returns the last modification time of a specified file. This function checks both the daily modification history of the file and the inode modification status. The inode modification status refers to changes in permissions, ownership, user group, or other metadata. If successful, the function returns the last modification time of the file in Unix timestamp format; if unsuccessful, it returns `FALSE`.
👁 143
PHP mysqli

PHP mysqli Language Notes PHP PHP collection PHP and mysql

Execute a database query: Delete database; <br/>?php // Assume database username: root, password: 123456, database name: RUNOOB; $con = mysqli_connect('localhost', 'root', '123456', 'RUNOOB...');
👁 232
php function explode

php function explode Language Notes PHP

After retrieving the text content from the form's textarea input field, use the `explode(' rn', $str)对字符串内容进行分割, 发现rn,n,r都无法分割.使用PHP_EOL常量却正常分割成为数组.$arr = explode(PHP_EOL, $str);` function.
👁 132
PHP solve json

PHP solve json Language Notes PHP

Solution 1: Use the urlencode and urldecode methods to bypass the header transformation process (headers: 'Content-Type: application/json; charset=utf-8'); $arr = array 'lang' => urlencode 'I speak Chinese'...
👁 183
Three ways to reverse string in php

Three ways to reverse string in php Language Notes PHP

(For example, given the string "abcd", implement string reversal using PHP): 1. The first method utilizes PHP's built-in `strrev` function for easy implementation: `strrev($str);` 2. Alternatively, split the string into an array and then traverse and concatenate the characters: `function joinStrrev($str...)`
👁 169
PHP file() function

PHP file() function Language Notes PHP

Definition and usage: The `file()` function reads an entire file into an array. Similar to `file_get_contents()`, the difference is that `file()` returns the file as an array. Each element in the array represents a corresponding line from the file, including the newline character. If the operation fails, it returns `false`. Syntax: `file(path, include_path, context...)`
👁 160
config database configuration and database connection

config database configuration and database connection Language Notes mySql

&lt;?php define('DB_NAME', ''); define('DB_USER', ''); define('DB_PASSWORD', ''); define('DB_HOST', 'localhost'); define('DB_CHARSET', 'utf8'); define…
👁 176
PHP uses QQ mailbox to send emails

PHP uses QQ mailbox to send emails Language Notes PHP

Usage method: 1. Introduce the mailbox integration php file https://wwa.lanzoui.com/iHt6Xuqu41g2. Use function: &lt;?php /*Sending email method *@param $to: receiver $title: title $content: email content *@return bool true: sent successfully false: sent...
👁 220
php gets current web page address

php gets current web page address Language Notes PHP

Determine whether it is https/** * Determine whether it is https * @return bool Returns true if it is https; otherwise returns false */ function is_https() { if ( !empty($_SERVER['HTTPS']) &amp;&amp; strtolower($_SERVE…
👁 152
define() function in php

define() function in php Language Notes PHP

`<?php define("PI", 3.1415926); // Define a constant $r=12;//定义圆半径 echo &quot;半径为12的单位的圆的面积&quot;.PI*($r*$r); // Calculate the area??>` In PHP, the `define()` function is commonly used to define constants; alternatively, `const` can be used...
👁 315
1 28 29 30 31 32 33