tp5 string divided combination

Before doing the file upload and modified to customize the file name, the file will be processed into json file format and transferred to another memory address. Now the document should address and deal with file names passed to the front of the file name suffix after the treatment is .json, so the file name to pass the time in front of the string type you want to modify the file name.

Check out a little bit but, did not seem like a python found in the replace () function similar to the function (do not know if not found).

Found php string operations in a explode (), similar to the python split (), is specified by the character string taken and assigned to an array.

So I think again after the first interception of the combination:

// read the database information corresponding to the id 
$ Result = Db :: Table ( 'File') -> WHERE ( 'file_id', $ fileId ) -> SELECT ();
 // acquired file name 
$ fileName = $ Result [ 0] [ 'file_name' ];
 // use explode isolated array, and acquires the first element 
$ fileName = explode (, '.' $ fileName [0) ];
 // suffix 
$ fileName = $ fileName '. .json ';

Methods feeling very stupid. . . But can

Guess you like

Origin www.cnblogs.com/rowan88/p/11258674.html