Hongmu Notes
Home Language Notes

Language Notes

PHP foreach jumps out of this/current loop and terminates the loop method

PHP foreach jumps out of this/current loop and terminates the loop method Language Notes PHP

`continue`: Exit the current iteration; `break`: Terminate the loop; `exit`: Ends the execution of the program; `return`: Ends a block of code; $arr = array('le', 'yang', 'jun', 'lecode', 'gagade');...
👁 201
js determines whether the mobile terminal and PC terminal jump to different pages

js determines whether the mobile terminal and PC terminal jump to different pages Language Notes JavaScript

Method 1: /* * * Determine whether the device is a PC or a WAP device */ var mobile_bs = {versions: function() {var u = navigator.userAgent; return {trident: u.indexOf('Trident')> -1, // IE kernel...
👁 225
How to set p tag not to wrap in css?

How to set p tag not to wrap in css? Language Notes CSS

The p tag is a block-level element and will occupy its own line. What if we want to set two p tags on the same line? Let's take a look at how to use css to set the p tag not to wrap. By default, the p tag will wrap automatically. Let’s take a look at how to use css to set the p tag not to wrap: Example p{display: inline;}<p>aaa</p> &l…
👁 280
Use css to add a hand style. Move the mouse up to make the hand smaller.

Use css to add a hand style. Move the mouse up to make the hand smaller. Language Notes CSS

Use css to add a hand style, move the mouse up to make the hand smaller, and make the hand smaller cursor:pointer; use JS to make the mouse smaller onmouseover (when the mouse passes over) onmouseover="this.style.cursor='hand'"cursor other values ​​auto: standard cursor default: standard arrow pointer,…
👁 171
How to refresh the verification code when clicking on it

How to refresh the verification code when clicking on it Language Notes JavaScript

Generally implemented through js, just reload the value of src<img src="index.php?p=back&c=Admin&a=captcha" onclick="this.src=this.src+'&k='+Math.random();"/…
👁 172
window.open() displays the window in the center

window.open() displays the window in the center Language Notes JavaScript

var iWidth = 400; //弹出窗口的宽度; var iHeight = 450; //弹出窗口的高度; var iTop = (window.screen.height-30-iHeight)/2; //获得窗口的垂直位置; var iLeft = (window.screen.wi...
👁 293
css3 grid layout

css3 grid layout Language Notes CSS

1. Overview Grid layout (Grid) is the most powerful CSS layout solution. It divides web pages into grids, and different grids can be combined arbitrarily to create various layouts. Effects that were previously only possible through complex CSS frameworks are now built into browsers. A layout like the one pictured above is the specialty of Grid layout. Grid layout and Flex layout have certain similarities, both can specify the content...
👁 218
php division rounding

php division rounding Language Notes PHP

When using the "/" operator for division, if the division is not exact, a floating-point number will be returned. What should I do if I only want to obtain the integer part? 1. `round` — Rounds a floating-point number. `float round(float $val [, int $precision]);` Returns the value of `val` rounded to the specified precision `precision` (...
👁 160
PHP replaces string only once

PHP replaces string only once Language Notes PHP

This is a method I found online – quite useful. It is designed for when the string A appears multiple times within string B, and you need to replace the first occurrence of string A in string B with another string; for example, this technique can be used to add links to keywords within article content. $needle=&gt;字符串A,$replace=> – The new string to replace string A with; $haystack=...
👁 191
CSS rounded corners

CSS rounded corners Language Notes CSS

CSS rounded corners can be used to achieve the "rounded" style of any element through the CSS border-radius property. CSS border-radius property The CSS border-radius property defines the radius of an element's corners. Tip: You can use this property to add rounded corners to your elements! Here are three examples: Here is the code: Example #rcorners1 { border-r…
👁 226
1 24 25 26 27 28 33