- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1466 Articles for PHP
221 Views
The array_change_key_case returns an array with all keys in lowercase or uppercase. It returns an array with its keys in lowercase or uppercase. It returns FALSE if array is not an array. Syntax array_change_key_case(arr, case) Parameters arr − The array. Required. case − Specify the case. The default is Lowercase i.e. CASE_LOWER. Optional. Return The array_change_key_case() function returns an array with its keys in lowercase or uppercase. It returns FALSE if array is not an array. The following is an example to convert all keys to uppercase. Example Live Demo Output ... Read More
146 Views
The array() function in PHP creates an array.Array is of three types in PHP.Indexed arrays − It is an array with numeric indexAssociative arrays − It is an array with named keysMultidimensional arrays − It is an array that have one or more arraysSyntax// array with numeric index i.e. Indexed arrays array(value1, value2...); // array with named keys i.e. associative arrays array(key1 => value1, key2 => value2...)Parametersvalue − Set the value.key − Set the key.ReturnThe array() function returns an array of the parameters.The following is an example of indexed arrays.Example Live DemoOutputElectronics Clothing Accessories FootwearThe following is an example of associative ... Read More
1K+ Views
The unlink() function deletes a file. It returns TRUE on success, or FALSE on failure. It returns TRUE on success and FALSE on failure.Syntaxunlink(file_path, context)Parametersfile_path − Set the name of the file to be deleted.context − Set the behavior of the stream.ReturnThe unlink() function returns TRUE on success and FALSE on failure.Example Live DemoOutputFile can’t be deleted!
191 Views
The umask() function changes permissions for files. It returns the current umask is it is set without arguments.Syntaxumask(mask)Parametersmask − Set the new permission.ReturnThe umask() function returns the current umask is it is set without arguments.ExampleOutputAccess changed!
193 Views
The touch() function sets access and modification time of a file. It returns TRUE on success, or FALSE on failure.Syntaxtouch(filename, time, atime)Parametersfilename − Set the name of the file.time − Set the time. The default is the current system time.atime − Set the access time. The default is the current system time.ReturnThe touch() function returns TRUE on success, or FALSE on failure.Example Live DemoOutputThe modification time of new.txt set to current time.Let us see another example.Example Live DemoOutputThe modification time of new.txt updated to 8 hrs in the past.
34 Views
The tmpfile() function creates a unique temporary file. It returns file pointer for the new file or FALSE on failure. Syntax tmpfile() Parameters NA Return The tmpfile() function returns file pointer for the new file or FALSE on failure. Example Live Demo Output This is demo text in temp file!
217 Views
The tempnam() function creates a temporary file with a file name which is unique. Syntax tempnam(dir, prefix) Parameters dir − The directory where the temporary file will get created. prefix − The beginning of the file Return The tempnam() function returns the new temporary filename or FALSE on failure. Example Output C:\testew\TMP1.tmp
115 Views
The symlink() function creates a symbolic link. It returns TRUE on success or FALSE on failure.Syntaxsymlink( target, link)Parameterstarget − Target of the link to be created.link − Name of the link.ReturnThe symlink() function returns TRUE on success or FALSE on failure.ExampleOutputSymlink created!
147 Views
The stat() function returns information about a file.Note − The results of the stat() function differs from server to server.The function returns an array with the below given elements.[0] or [dev] - Device number[1] or [ino] - Inode number[2] or [mode] - Inode protection mode[3] or [nlink] - Number of links[4] or [uid] - User ID of owner[5] or [gid] - Group ID of owner[6] or [rdev] - Inode device type[7] or [size] - Size in bytes[8] or [atime] - Last access time as Unix timestamp[9] or [mtime] - Last modified time as Unix timestamp[10] or [ctime] - Last inode ... Read More
30 Views
The set_file_buffer() function sets the buffer size of an open file. The function returns 0 on success, otherwise it returns EOF.Syntaxset_file_buffer(file_pointer, buffer)Parametersfile_pointer − The file pointer.buffer − The buffer size in bytes.ReturnThe set_file_buffer() function returns 0 on success, otherwise it returns EOF.Example Live DemoOutputbuffer set