Run the following command
sed -i '1,200d' file_name.sql
Run the following command
sed -i '1,200d' file_name.sql
stream_wrapper_register(protocol, classname) Registers a protocol; implementation is part of the class
The class implements standard functionality like reading, writing, or changing the file position.
php_user_filter is a predefined class in php and is used in conjunction with user-defined filters.
int stream_copy_to_stream ( resource source, resource dest [, int maxlength [, int offset]] )
Makes a copy of up to maxlength bytes of data from the current position (or from the offset position, if specified) in source to dest. If maxlength is not specified, all remaining content in source will be copied.
stream_copy_to_stream($source_file, $destination_file);
The function parses the HTML document in the file named filename. Unlike loading XML, HTML does not have to be well-formed to load.
This function may also be called statically to load and create a DOMDocument object. The static invocation may be used when no DOMDocument properties need to be set prior to loading.
The following can prevent PHP from being able to open a file on the hard drive
A. File system permissions
B. File is outside of open_basedir
• The PHP directive file_uploads must be set to On
• The form’s method attribute must be set to “post”
• The form’s enctype attribute must be set to “multipart/form-data”
o Provide information on protocols and encodings
can be any file wrapper
allows for two pipelines at most – for reading & writing
o Prefix in front of a file path
file:// php://
http:// compress.zlib://
https:// compress.bzip2://
ftp:// ftps://
o Custom Wrappers
stream_wrapper_register(protocol, classname)
Registers a protocol; implementation is part of the class.
the class implements standard functionality like reading, writing, or changing the file position
php_user_filter is a predefined class in php and is used in conjunction with user-defined filters
It deletes the file
Example
<?php
unlink(“test.txt”) or die(“Failed”);
?>
It changes file permissions of file
Example
<?php
$file = umask(0);
chmod(“test.txt”, 0755);
umask($file)
?>
It sets access and modification time of file
Example
<?php
touch(“test.txt”);
?>