$link = mysql_connect ("Mysql_host", "Mysql_user", "Mysql_password") or Die ("Could Not connect:". Mysql_error ());
mysql_query ("Set names UTF8");
mysql_select_db ("My_database") or Die ("Could not select Database");
?>
Database I use MySQL PDO but the whole idea is the same.
$conn =mysql_connect (' localhost ', ' root ', ' 123 ');
if (Mysql_errno ()) {
printf (' Connection failed '. Mysql_error ());
}
mysql_select_db (' Edeng ');
Require_once (' pinyin_table.php ');
function Get_pinyin_array ($string)
{
Global $pinyin _table;
$flow = Array ();
for ($i =0; $i<>{
if (Ord ($string [$i]) >= 0x81 and Ord ($string [$i])
{
$h = Ord
Var_dump (0 = = ' Test ');
Var_dump (0 = = ");
Var_dump (5 > ' t ');
Var_dump (strcmp (5, ' t '));
Copy CodeThe result is (the 1th to 3rd result is wrong, only the 4th one is correct): 4bool (TRUE) bool (TRUE) bool
This article has shared the PHP Socket function library commonly used functions, has the research PHP socket programming friend, may refer to the study.
PHP Socket Function Library:Function name Description socket_accept () accepts a socket
$arr = Array (' A ', ' B ', ' C ', ' d ');
Unset ($arr [1]);
Print_r ($arr);
?>
Copy CodeAfter trying to use unset, the array $arr should compress the array to fill the missing element position, but after Print_r
$t =time ();
echo Date ("Y-m-d h:i:s", $t);
Copy CodeThe format of the first parameter represents: A-"AM" or "PM" A-"AM" or "PM" D-a few days, two digits, if less than two digits before 0; such as: "01" to "D"-Day of the week, three
This article describes the method of PHP string collation, including access to a single character, delete whitespace characters, HTML escape and other operations, the need to refer to a friend.PHP implements the access to characters in strings,
Class Request
{
Public Function __construct ()
{
if (!GET_MAGIC_QUOTES_GPC ())
{
if (!empty ($_post))
{
foreach ($_post as $k = & $v)
{
if (Is_array ($v))
{
@array_walk ($v, ' urldecode ');
$str = ' 1234567890 ';
$needle = ' 234 ';
$result = STRCHR ($str, $needle);
Var_dump ($result);
copy code Result: String ' 234567890 ' (length=9) Strrpos looks for a character in the string where the last
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service