$id = 23;
$sn = 0023;
添加前导零:
方法一:$sn = sprintf("%04d",$id);
方法二:$sn = str_pad($id,4,"0",STR_PAD_LEFT);
去掉前导零:
方法一:$id = intval($sn);
方法二:$id = ltrim($sn,"0");
http://pcwanli.blog.163.com/blog/static/4531561120122129305185/
SHELLEXECUTE
To launch an application or execute a file in Win32 environment we will use the ShellExecute Windows API function. Check out the help on ShellExecute for a full description of parameters and error codes returned.
As you will see we can open any type of document from our program without knowing which program is associated with it (this link is defined in the Windows Registry).
As you will see we can open any type of document from our program without knowing which program is associated with it (this link is defined in the Windows Registry).
Let's see some shell action!
Be sure to add ShellApi to your Unit's uses clause.
Be sure to add ShellApi to your Unit's uses clause.
Run Notepad
Open SomeText.txt with Notepad
Display the contents of the "DelphiDownload" folder
Execute a file according to its extension.
Here's how to Find an application associated with an extension
Open web site or a *.htm file with the default web explorer
Here's how to Open a Web Browser in a new window
Send an e-mail with the subject and the message body
Here's how to send an email with the attachment
Execute a program and wait until it has finished. The following example uses the ShellExecuteEx API function.