Codeigniter 4 include php file in view
- how to include php file in codeigniter
- code php example
- codeigniter examples
- codeigniter include php file in view
Layout in codeigniter
How to include header and footer in codeigniter 3.
Working with Files
New Features
In addition to all of the methods in the SplFileInfo class, you get some new tools.
getRandomName()
You can generate a cryptographically secure random filename, with the current timestamp prepended, with the method.
This is especially useful to rename files when moving it so that the filename is unguessable:
// Generates something like: 1465965676_385e33f741.jpg$newName=$file->getRandomName();
getSize()
Returns the size of the file in bytes:
$size=$file->getSize();// 256901
A will be thrown if the file does not exist or an error occurs.
getSizeByUnit()
Deprecated since version 4.6.0.
Returns the size of the file default in bytes.
You can pass in either or as the first parameter to get the results in kibibytes or mebibytes, respectively:
$bytes=$file->getSizeByUnit();// 256901$kilobytes=$file->getSizeByUnit('kb');// 250.880$megabytes=$file->getSizeByUnit('mb');// 0.245
A will be thrown if the file does not exist or an error occurs.
getSizeByBinaryUnit()
Returns the size of the file default in b
- codeigniter include php file in controller