Hongmu Notes
Home PHP PHP collection

PHP collection

PHP is a high-performance scripting language used for developing websites and applications; it enables developers to quickly create powerful web applications. PHP scraping code refers to a specific type of PHP code that can efficiently retrieve information from websites. By using this code, developers can more easily fetch relevant data from the internet and integrate it into their own web pages or applications.

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 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...');`
👁 183
PHP preg

PHP preg Language Notes PHP PHP collection

&lt;?php $userinfo = &quot;Name: &lt;b&gt;PHP&lt;/b&gt; &lt;br&gt; Title: &lt;b&gt;Programming Language&lt;/b&gt;&quot;; preg_match_all (&quot;/&lt;b&…
👁 169
PHP special character escaping and restoration

PHP special character escaping and restoration Language Notes PHP PHP collection PHP and mysql

Escape character is a special character constant. Escape characters are backslashed " & quot; At the beginning, followed by one or more characters. The escaped character has a specific meaning, which is different from the original meaning of the character, so it is called "escaped" character. The use of escape characters 1: turn ordinary characters into special purposes, such as back key and enter key. 2. Used to convert a character with special meaning back to its original meaning. 3. Before data is written into the database, escape characters (function …
👁 180
PHP capture website source code and json parsing

PHP capture website source code and json parsing Language Notes PHP PHP collection

Recently, I wanted to collect the names of some resource websites, so I found a fun one when I collected it. The opposite website was loaded by ajax technology, so I found the api, so I just wrote the code directly to put it in the warehouse. The code is backed up here and will be used in the future. & lt; ? php $date = file_get_contents(' Website address ' ); $date = json_deco…
👁 136
PHP regular replacement preg

PHP regular replacement preg Language Notes PHP PHP collection

& lt; ? php $str=& quot; as2223adfsf0s4df0sdfsdf& quot; ; echo preg_replace(& quot; /0/& quot; ,& quot; & quot; ,$str); //Remove the 0 character, which is equivalent to the function of replace, preg _ replace (&; quot; /…
👁 167
PHP cast type

PHP cast type Language Notes PHP PHP collection PHP and mysql

Get the data type 1. If you want to check the value and type of an expression, use var_dump(). 2. If you just want to get an easy-to-read type expression for debugging, use gettype(). 3. To check a certain type, do not use gettype(), but use the is_type() function. Converting Strings to Numbers When a string is evaluated as a number, the result is determined according to the following rules...
👁 232
1 2 3