In the background program to run a problem, the detailed log is an indispensable helper, here provides a way to automatically record the log trigger point file name, line number, function name, the key is to take advantage of C99 new preprocessing
The dictionary has a very good method, is get, can prevent Keyerror exception, can also set a default value for the nonexistent keyFor example:V=d.get (' k ', ' default ')The list does not have a similar method, and if the index of the access
Introduce the Get () function first:
Url,[data],[callback],[type]
Parameter description:URL: The URL address of the page to be loadedData: Key/value parameter to be sent.Callback: callback function when load succeeds.Type: Returns the content
JS common indexof URL, domain name, browse type get function*/
function Pv_rport (dm,f) {var i = Dm.indexof (f);if (i > 0) {Return dm.substring (0, I);}return DM;}
function Getrefurl (refurl) { if (refurl.indexof (' REF0 ') >-1) { var
PHP gets the current script URL (only path)
Copy CodeThe code is as follows:
function Getcururl ()
{
if (!empty ($_server["Request_uri"))
{
$scrtName = $_server["Request_uri"];
$nowurl = $scrtName;
}
Else
{
$scrtName = $_server["Php_self"];
if
Void get (void * & P, Int & N)
{
If (P = NULL)
{N = 10;
P = new void [N];
}
.....
}
The parameter must be specified. If the parameter is null, it can be extracted. The parameter also leads to the space size.
The returned value can be other
If the current function is a famous function, its name is returned. If it is an anonymous function, the variable name of the function to be assigned is returned. If it is an anonymous function in the closure, "Anonymous" is returned ".
VaR
This time to bring you the PHP dynamic access to function parameters of the steps in detail, PHP dynamic access to the function parameters of the note, the following is the actual case, together to see.
PHP supports a variable number of parameter
function War ($a, $b, $c)
{
$n = Func_num_args ();
Echo $n;
}
War (+/-);
Func_num_args () This function can only get the number of arguments in the function and cannot be obtained outside the function, what method can get the number of function
1. Inherit from a single controllerWhen we write the thinkphp controller, it is a separate controller file. In actual projects, each controller may need the same verification, in this case, we can use the public controller to write the corresponding
function War ($a, $b, $c)
{
$n = Func_num_args ();
Echo $n;
}
War (1,2,3);
Func_num_args () This function can only get the number of parameters inside the function can not be obtained outside the function, what method can get the number of
This example describes the PHP custom extension fetch function. Share to everyone for your reference, specific as follows:
More about PHP Interested readers can view the site topics: "PHP commonly used functions and skills summary", "PHP
Personal understanding of Java Reflection: Reflection is a set of methods for understanding classes and using classes ;
The Java basics know how to instantiate a class, and also know how to invoke a variable or method through an instance;But many
This article combines some of the relevant articles I found on the internet here to tidy up:
In the later version of VS, VC6 can get the name of the function in the function body through __funcsig__;
But to do it yourself in VC6, here's how I found
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.