python unicode字符串转成中文
s = 'u6d4bu8bd5u957fu5ea6' s = s.replace('u', '/u') print s.decode('unicode-escape')
php 二进制直接量
$bin = bindec('110011'); $bin = 0b110011;
php foreach list
$arr = [ [1, 2], [3, 4],];foreach ($arr as list($a, $b)) { echo $a.$b/n";}
PHP ==和隐式转换
var_dump(md5('240610708') == md5('QNKCDZO'));// true 两个字符串恰好以0e 的科学记数法开头,字符串被隐式转换为浮点数,也就等效于0×10^0var_dump(sha1('aaroZmOk') == sha1('aaK1STfY'));// truevar_dump('0x1234Ab' == '1193131');// true 0x1234Ab转为16进制,php7无此bugvar_dump( 0 == "a" );// truevar_dump( "0" == "a" );// true
== 、switch、in_array 的松比较
// 如果 $name 值为 0,那么它会满足任何一条 caseswitch ($name) {// 使用switch (strval($name)) { case "danny": break; case "eve": break;}$needle = '1abc'; $haystack = array(1,2,3); var_dump(in_array($needle, $haystack);// true
javascript Date对象的浏览器兼容性问题
// chrome同时支持’-‘和’/’分割日期的时间字符串;safari不支持’-‘分割日期的时间字符串
var arr = "2010-03-15 10:30:00".split(/[- / :]/), date = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]);
javascript 模拟Object.keys()
function keys(obj){ var a = []; for(a[a.length] in obj); return a;}
javascript数组去重
function dedupe(array){ return Array.from(new Set(array));}dedupe([1,1,2,3]) //[1,2,3]
工具
// 命令行提示tldr npm install -g tldr
octotree是一款可为 GitHub 和 GitLab 添加侧边栏文件导航的 Chrome 和 Opera 插件
python下载视频工具Sublime Text3 汉化
// Package Control:Install Package,输入Chinese,选择ChineseLocalization
javascript reduce
arr = [1,2,3,4,5] arr.reduce(function(a,b){ return a*10+b; });//12345var result = [1, 2, 3, 4, 5].reduce(function(prev, curr, index, array){debugger; prev.push(curr * 2); return prev;}, []);console.log(result);//[2, 4, 6, 8, 10]//求最大值var max = arr.reduce(function(pre,cur,inde,arr){return pre>cur?pre:cur;});var arr = [ {name: 'brick1'}, {name: 'brick2'}, {name: 'brick3'} ]function carryBricks(arr){ return arr.reduce(function(prev, current, index, array){ if (index === 0){ return current.name; } else if (index === array.length - 1){ return prev + ' & ' + current.name; } else { return prev + ', ' + current.name; } }, ''); }//brick11, brick12 & brick13//去重var arr = [1, 3, 1, 'x', 'zz', 'x', false, false];var result = arr.reduce(function(prev, curr, i, array) { var flag = prev.every(function(value) { return value !== curr; }); flag && prev.push(curr); return prev;}, []);console.log(result);
jquery插件
输入提示自动完成插件 tokeninput
tablesorter表格排序
Date.js执行日期/时间的计算
图片裁剪
日期选择插件pickadate.js
javascript刻度条插件0.1+0.2
Math.round( (.1+.2)*100)/100; //0.3
mysql分解联合查询
select * from teacher join school on teacher.id = school.idjoin course on teacher.id = course.idwhere course.name= 'english' 分解后 select * from course where name = 'english'select * from school where course_id = 1select * from teacher where school_id in (1,2,3)
字符串中每个字母重复出现的次数
var temp = {}; 'abcdaabc'.replace(/(/w{1})/g,function($1){ temp[$1] ? temp[$1]+=1 : temp[$1] = 1; }) console.log(temp) // {a: 3, b: 2, c: 2, d: 1}
composer
PHP HTTP请求套件
实现 Laravel 模型的无限极分类php一维数组 转 多维数组
$arr = ['a', 'b', 'c', 'd'];$child = array();$res = [];while($v = array_pop($arr)) { $res = [$v => $child]; $child = $res;}
python中字符串的按位或
a = "1000111000"b = "1000000001"c = int(a, 2) | int(b, 2)print('{0:b}'.format(c))#1000111001
python生成斐波拉契数列
def fib(max): n, a, b = 0, 0, 1 while n < max: print(b) a, b = b, a + b n = n + 1 return 'done'
php正则匹配
$str="{a:1,b:2,c:3}"; preg_match_all('/(/w+):(/d+)/', $str, $matches); $arr = array_combine($matches[1], $matches[2]);#['a'=>1,'b'=>2,'c'=>3]
php max/min
max(ceil(-0.5), 0) # -0.0max(0, ceil(-0.5)) # 0
NaN
_.isNaN = function(obj){ return _.isNumber(obj) && obj !==+obj;};
Mysql 用 一张表中的数据更新另一张表的数据
update tableA as ca inner join tableB as cb set ca.thumbs=cb.thumbs where cb.courseid=1;24.php后期静态绑定
class A { public static function get_self() { return new self(); } public static function get_static() { return new static(); } } class B extends A {} get_class(B::get_self());//A get_class(B::get_static()) //B get_class(A::get_static());//A
json_encode输出动态javascript
$images = array( 'myself.png' , 'friends.png' , 'colleagues.png' ); $js_code = 'var images = ' . json_encode($images); echo $js_code; // var images = ["myself.png","friends.png","colleagues.png"]
String.fromCharCode
var regex_num_set = /&#(/d+);/g;var str = "Here is some text: 每日一色|蓝白~"str2 = str.replace(regex_num_set, function(_, $1) { return String.fromCharCode($1);});//"Here is some text: 每日一色|蓝白~"

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.