If you get a second $str[1] or $str{1}, {} is not recommended, preferably using []Test as follows
Copy Code code as follows:
Get the last character of a character
$str = ' phpddt.com ';
echo $str [Strlen ($STR)-1]; M
Modify the first
I found a little time on the internet.
Then I thought of a way, it is original.
It's just a function of interception plus substitution.
Copy Code code as follows:
function Smssubstr ($string, $length) {
if (strlen ($string) return $string;
Because this is a language problem, the general scheme is difficult to solve. The following is a scenario that is resolved by using string.
Copy Code code as follows:
$total = 100000;
$double = "";
for ($i = 0; $i {
$double. = Pack ("D",
Observer mode
Copy Code code as follows:
Interface Subject
{
Public Function Attach ($Observer); Add Observer
Public Function Detach ($Observer); Kick out The Observer
Public function Notify (); Notify observers when conditions are
As a senior and professional Skinner personnel, I began to invest in the great Internet from the beginning to now accumulated a wealth of Skinner experience. I'm sure every web programmer will have a similar experience.
In the Skinner process, it
Want to achieve such a function: Launch a website invitation activity, then the participant (owner) will promote the website address link sends the friend, the friend clicks the link to register successfully after the website, owner's invitation log
The null merge operator is a good thing, and with it we can easily get a parameter and provide a default value if it is empty. For example, in JS can be used | | To engage in:
function Setsomething (a) {
a = a | | ' Some-default-value ';
PHP more and more applications, but also more and more extensive, in order to increase the richness of the site, resulting in a lot of new technology. Ajax is a modern web site can not be a lack of technology, he can refresh the data asynchronously,
Implementation code, replication is used:Header ("Content-type:text/html;charset=utf-8");function Getrandpass ($length = 6) {$password = ';Add the characters you want to the string below, the default is the number 0-9 and the 26 English
First, the header information is defined to indicate that an Excel is output. Then in the form of a table to the database information loop echo out, just fine.
Copy Code code as follows:
Header ("Content-type:application/vnd.ms-excel")
This paper illustrates a simple way to realize the one-dimensional array of PHP multidimensional arrays. Share to everyone for your reference, specific as follows:
The PHP language itself does not convert multidimensional arrays into
/**
* Fills a string into a string of a specified length (multibyte security)
* @param string $str Specify the filled strings
* @param int $len Specifies the length of the filled string, not if the value is negative or less than the length of the
The following is a script to unify the deletion of a table prefixed with "prefix_":
Copy Code code as follows:
Set up database connection information. Database server address, database username, data password
mysql_connect (' Database
Copy Code code as follows:
———————————————————————————–
Function name: Checklengthbetween ($C _char, $I _len1, $I _len2=100)
Role: Determine whether the string within the specified length
Parameters: $C _char (string to be detected)
$I _len1
These days to engage in ss7.5 dz7.2 uc1.5 uchome2.0 and the integration of their main station is the head of the big
Oh, well, at least it's almost done. Record the ss7.5 data call
DZ and home data calls well, that's pretty obvious. The admin
The Requirement is this, need to log in with the authentication Code of the website, get the data, but it is impossible for people to record data, want to go through the way of automatic collection, the following is the result of the test code!
It is estimated that many children playing Smarty templates have encountered the problem of cutting garbled. Especially the UTF8 code.
The following code is saved modifier.truncate2.php to the plugin directory under Smarty Libs
And then you cut it
The example in this article describes the calendar program that PHP implements. Share to everyone for your reference. as follows:
";
echo "Back";
Exit (); ?> if ($month 12) {$month = 1;
$year +=1; //// echo " year >> "; ?> month >> "
This article introduced a no refreshing news message system, the most concise and understandable an AJAX no refresh message system, the source code omitted the process of accepting data validation, we can expand according to their needs, the
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