Hongmu Notes
Home Language Notes

Language Notes

html css title displays one line and hides the excess part

html css title displays one line and hides the excess part Language Notes CSS

To make the title display one line in HTML and hide the excess part, you can use CSS styles to control how the element is displayed. The following is a commonly used method: HTML code: <div class="title"> <h1>This is a very, very long title, and the excess part needs to be hidden</h1> </div>CSS code:…
👁 197
PHP batch image width/height modification

PHP batch image width/height modification Language Notes PHP

Save this somewhere so you don't lose it – otherwise, you might spend a long time searching for it when you need it, or just save it when you don't need it! <?php die(); // $array = glob(__DIR__ . '/*.{jpg,jpeg,png,gif}',GLOB_BRACE); // print_r($array); // foreach ($array...
👁 142
Replace the content of a specified field in a MySQL data table with the text preceding the content.

Replace the content of a specified field in a MySQL data table with the text preceding the content. Language Notes mySql

This might sound a bit complicated, but the logic is correct! For example, if the field value is "[Hello, I'm your friend]," and you want to replace everything before the substring "[I'm]" with an empty string, this is exactly the effect you're aiming for. You can achieve this using MySQL's `SUBSTRING_INDEX()` string function in conjunction with the `REPLACE()` function. Here's an example query: `UPDATE table_name SET field_name = REPLACE(...);`
👁 151
EmpireCMS uses PHP to directly submit data for updating articles.

EmpireCMS uses PHP to directly submit data for updating articles. Program Notes Empire cms Language Notes PHP

Submitted code: While having some free time, I took the time to thoroughly study the Train Engine module and integrate it with Empire CMS, resulting in the following code. Experienced PHP developers are welcome to modify this code; however, this is merely a simple submission script – the data must be configured manually! <?php $url = "http://www.4s5.cn/e/admin/123.php"; // Replace this with the actual URL where the data should be received...
👁 386
Use PHP to batch-import millions of TXT files into a database.

Use PHP to batch-import millions of TXT files into a database. Language Notes PHP

Currently, the MySQL database is an excellent choice for storing data; therefore, the corresponding code is: <?php // Call the function // moveFilesByExtension('~/Recycle Bin', '~/Sentence Collection', '.txt'); die(); // Database connection information $servername = "localhost"; $username...
👁 182
Move tens of millions of files with specified extensions using PHP.

Move tens of millions of files with specified extensions using PHP. Language Notes PHP

Got it! You want to write a function that takes three parameters – the source folder path, the target folder path, and the file extension – and moves files with that specific extension from the source folder to the target folder. Here's an example of the code: `function moveFilesByExtension($sourceDir, $targetDir, $fileExtension...)`
👁 187
PHP converts web pages into PDF files.

PHP converts web pages into PDF files. Language Notes PHP

1. Install TechnickCom/TCPDF. 2. Code: `<?php // Include the TCPDF class file: require_once('../vendor/autoload.php'); require('../../action/class/common.php'); // Use TCPDF\TCPDF; $f...`
👁 161
How can you create a table B with the same data structure as table A using MySQL?

How can you create a table B with the same data structure as table A using MySQL? Language Notes mySql

Recently, I've been fiddling with a data table: `CREATE TABLE B LIKE A;`
👁 128
PHP + HTML + jQuery + Bootstrap – Functional page for querying and modifying a database

PHP + HTML + jQuery + Bootstrap – Functional page for querying and modifying a database Language Notes PHP mySql JavaScript Bootstrap

The screenshot is as follows: `index.html` `<!DOCTYPE html>` `<html lang="en">` `<head>` `<meta charset="UTF-8"` `<meta name="viewport" content="width=device...`
👁 259
How can the data table rearrange the primary key from 1 without affecting other contents?

How can the data table rearrange the primary key from 1 without affecting other contents? Language Notes mySql Summary of pitfalls

After studying all morning, I finally found a solution. One primary table and one secondary table, and want to rearrange the primary keys of two tables at one time. Originally said to rely on PHP to traverse processing, the result is outrageous, too slow, so directly on SQL code processing! SQL Code: Hidden Content: View after comments # Create Item _ Instance _ New Create Table Item _ Instance _ N …
👁 204
1 2 3 4 5 6 33