Hongmu Notes
Home Language Notes PHP

PHP

PHP (Hypertext Preprocessor) is a server-side scripting language particularly suited for web development and can be embedded within HTML. Its syntax is derived from the C language, incorporating features from languages such as Java and Perl to develop its own distinctive grammar; it has also been continuously refined and enhanced based on the strengths of these languages—for example, leveraging Java's object-oriented programming capabilities.

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 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
How to generate QR code in php

How to generate QR code in php Language Notes PHP

Use the PHP QR Code library to generate QR codes: After downloading the library provided by the official website (via the link at the bottom), simply use the `phpqrcode.php` file to generate QR codes – however, your PHP environment must support GD2. The `phpqrcode.php` file provides a key `png()` method; the parameter `$text` specifies the text data to be encoded into the QR code; the parameter `$outfile...`
👁 474
php mysqli database connection

php mysqli database connection Language Notes PHP PHP collection PHP and mysql

MySQLi database connection: `<?php define('DB_NAME', 'api_4s5_cn'); define('DB_USER', 'api_4s5_cn'); define('DB_PASSWORD', '4Eh6DEsLCT5HebjR'); define('DB_HOST', 'lo...');`
👁 182
php sends post data

php sends post data Language Notes PHP

<?php /** * Curl Version * Usage: * $post_string = &quot;app=request&amp;version=beta&quot;; * request_by_curl('http://localhost/restServer.php', $post_st...
👁 128
Analysis of the efficiency difference and application situation between switch and ifelse in php

Analysis of the efficiency difference and application situation between switch and ifelse in php Language Notes PHP

This article provides a practical analysis of the efficiency differences and appropriate use cases between the `switch` and `if–else` statements in PHP – shared here for your reference. The detailed analysis is as follows: Both of these PHP control structures are used to determine whether a value meets a specific condition and to execute different actions accordingly (whether the condition is met or not). Regardless of the programming language used, developers always need to consider the execution efficiency of their code. After reviewing various resources, it was found that the `switch` and `if–else` statements behave differently in various scenarios...
👁 149
How to determine whether an email is correct in php

How to determine whether an email is correct in php Language Notes PHP

<?php $email = &quot;demo@example.com&quot;; if (filter_var($email, FILTER_VALIDATE_EMAIL)) {echo '" ". $email. " " is valid.';} else {echo...
👁 112
1 18 19 20 21 22