If you have max code execution limit error you can try resolve with following code ini_set("max_execution_time", "1800"); ini_set('memory_limit','1048M'); if you want to display all hidden php errors ini_set('display_errors', 1);
If you have max code execution limit error you can try resolve with following code ini_set("max_execution_time", "1800"); ini_set('memory_limit','1048M'); if you want to display all hidden php errors ini_set('display_errors', 1);
When customizing image names or file names during uploads, it is necessary to generate larger unique names. It can be done with following php function. function generateRandomString($len = 80){ $base = 'abcdefghjkmnpqrstwxyz123456789'; $max = strlen($base)-1; $string = ''; while(strlen($string) ...
Aws s3 is handy tool for storing and managing large image base for work. Following is the code skeleton for this purpose. require $_SERVER['DOCUMENT_ROOT'].'/assets/s3-upload/vendor/autoload.php'; // s3 image upload /////////////////// if(!empty($_FILES)){ $s3 = new Aws\S3\S3Client([ 'region' => $this->config->item('s3_region'), 'version' => 'latest', 'credentials...
public function export($results){ $file_name = 'fusion_search_on_'.date('Ymd').'.csv'; header("Content-Description: File Transfer"); header("Content-Type: application/csv;"); header("Content-Disposition: attachment; filename=$file_name"); // file creation $file = fopen('php://output', 'w'); $header = ['Incoming Date','WWNDT Job #', 'Operator', 'Division', 'Job Number',...
When php 5.6 is upgraded from php 5.4, this error happens. In order to fix it following two commands are needed in ubuntusudo apt-get install php5.6-xmlsudo service apache2 restart
<p>Sometimes it is necessary to automate tasks with cron job in a project. In order to do that cpanel gives some default syntax. Along with that you need to curl the url to setup the cron job correctly.</p><p>Following is one example way of doing it.</p><p>curl --silent https://some-url.com &amp; &gt;/dev/null<br /><br />Above --silent is used to a...
This can be done in following way. FIrstly, in the coding you need to setup and put youtube api key. Secondly, use the channel id from where you want to bring the youtube videos. $API_key = 'youtube-api-key'; $channelID = 'channel-id'; $maxResults = 10; $videoList = json_decode(file_get_contents('https://www.googleapis.com/youtube/v3/search?order=date&part=snippet&channelId...