This problem is not difficult, the test center is mainly in function substr () STRRCHR () Array_pop () Strrpos () Strpos (), Strrev () explode ().
No more nonsense to say, directly to everyone paste code.
Get file suffix, traverse directory
PHP$a= "@[email protected]"; $trim=Trim($a,‘@‘);//Remove the @//var_dump ($trim) on the left and right side; $ltrim=LTrim($a,‘@‘);//Remove the @//var_dump ($ltrim) on the left; $rtrim=RTrim($a,‘@‘);//Remove the @//var_dump ($rtrim) on the
FIG-PHPPSR specification series 4-automatic loading 1. PSR-4 specification: automatic loading
Although it was pointed out in [PSR-4-Meta] that the PSR-4 was a supplement to the PSR-0 specification rather than a replacement, but it had been written
Php4 has no static membersThe following error occurs in the php webpage background. The error message "SubPages1.php" is not found. This error occurs when the website is tested locally. The verification code is invisible. For example, Parse error:
This article mainly introduces PHP to get the current execution of PHP file name code, the need for friends can refer to the following
Today write the wall when the navigation judge encountered this problem. My solution is this:
Judge the current
This article is mainly to share with you that PHP only shows the hidden methods of the characters behind the provinces and cities, we will share in the form of code, hoping to help everyone.
Hides the string behind the provinces and cities,
I want to write a discuz plugin, this plug-in function involves uploading files this function, so the Novice's vision to learn the next PHP upload file. First, W3cshool checked the case, I think he said very detailed, even I this rookie have a
This problem is not difficult in fact, the test center is mainly in the function substr () STRRCHR () Array_pop () Strrpos () Strpos () Strrev () explode () PathInfo ().
Not much nonsense to say, directly to everyone put the code.
Get file suffix,
Do you want to put your pants off and fart? you can see a piece of code written in this way $ site_url & nbsp; strtolower (. $ _ SERVER [HTTP_HOST]. substr ($ _ SERVER [PHP_SELF], & nbsp; 0, & nbsp; strrpos ($ _ SERVER [PHP_SELF], & nbsp; index. php)
1. Formatted output
Chop is the alias of RTrim ();
LTrim ()
Trim ()
NL2BR () converts \ n to
print,echo,printf (), sprintf ():
Echo () is not a function, print () is a function, has a return value, boolen,false,true;
printf () Formatted
Very extreme examples, a disguised solution to the problem of thinking, recorded, for later use.
How do I remove the suffix of a file's default name?
$fileName = A.txt
Two methods:
1: Borrow PHP's Strrchr+trim method: STRRCHR (STRING1,STRING2)
1. PSR-4 Specification: Automatic loading
Although it is noted in [Psr-4-meta] that PSR-4 is a supplement to the PSR-0 specification rather than a replacement, it has been written in [PSR-0] that PSR-0 was abandoned in 2014.10.21 and that the Psr-4
How PHP gets the suffix name of the file,
The suffix of a slice file, jpg or GIF, etc.
There are two ways of
One, if $img is the picture file name
$img =12345.gif; $img _ext = substr ($img, Strrpos ($img, '. '));
Second, use the PHP array, first
Php4 has no static members
The following error occurs in the php webpage background. The error message "SubPages1.php" is not found. This error occurs when the website is tested locally. The verification code is invisible. For example, Parse error:
An extreme example is a disguised solution. It is recorded for future use.
How do I remove the suffix of the default file name?
$ Filename = a.txt
Two methods:
1: Use the strrchr + trim method of PHP: strrchr (string1, string2) to return the
Preg_replace problems, asking for help
$wupin = "A category 0:::::: Name 1:::::: Brand/Manufacturer 2:::::" Specifications 3 ":":.: "Number of the changes to be changed 4::::: Unit 5::::: £ º 6:; B Category 0:::::: Product 1::::::
This is a job need to package download the current product of all the pictures to the local, file format for the zip compressed package, packaging download files and pictures, the program details for the actual situation, the use of the need to
A very extreme example, a kind of solution to the problem of thinking, recorded, for later use.
How do I remove the suffix of the file default name?
$fileName = A.txt
Two ways:
1: Borrow PHP's Strrchr+trim method: STRRCHR (String1,string2) returns
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.