Category : PHP

82 posts

How to remove multiple keys from PHP Array? In this example, we will remove array elements by keys array in php. we can delete multiple keys from array php. basically we will unset multiple keys from php array. if you see in php documentation there are not available directly remove multiple keys from php array. …
Preview Installation The Captcha Service Provider can be installed via Composer by requiring the mews/captcha package and setting the minimum-stability to dev (required for Laravel 5) in your project’s composer.json. { "require": { "laravel/framework": "5.0.*", "mews/captcha": "~2.0" }, "minimum-stability": "dev" } or Require this package with composer: composer require mews/captcha Update your packages with composer update or install with composer install. In Windows, you’ll need to include …
In this example, we will remove array elements by keys array in php. we can delete multiple keys from array php. basically we will unset multiple keys from php array. if you see in php documentation there are not available directly remove multiple keys from php array. But we will create our own php custom …
We can create our own php.ini file in godaddy cpanel and other hosting too. We can increase upload_max_filesize, post_max_size, max_file_uploads, memory_limit, max_execution_time etc in php ini file in cpanel. So basically, Almost server like godaddy server, a2hosting server, hosting raja server that provide basic configuration in default php ini file. so some time we need …
Do you want to calculate difference between two dates in PHP? I mean difference between two dates in days, months, years using php. if yes than i will show you to PHP get difference between two dates using strtotime(), abs() and floor(). We may sometime require to get difference between in PHP for your application, …
Definition and Usage The date() function formats a local date and time, and returns the formatted date string. Syntax -:  date(format,timestamp); Parameter  Description format Required. Specifies the format of the outputted date string. The following characters can be used: d – The day of the month (from 01 to 31) D – A textual representation …
sort() – sort arrays in ascending order. asort() – sort associative arrays in ascending order, according to the value. ksort() – sort associative arrays in ascending order, according to the key. arsort() – sort associative arrays in descending order, according to the value. rsort() – sort arrays in descending order. krsort() – sort associative arrays …
/* create zip folder */ public function zip(){ $getImage = $this->cart_model->getImage(); $zip = new ZipArchive; $auto = rand(); $file = date(“dmYhis”,strtotime(“Y:m:d H:i:s”)).$auto.’.zip’; if ($zip->open(‘./download/’.$file, ZipArchive::CREATE)) { foreach($getImage as $getImages){ $zip->addFile(‘./assets/upload/photos/’.$getImages->image, $getImages->image); } $zip->close(); $downloadFile = $file; $download = Header(“Location:http://localhost/projectname/download/”.$downloadFile); } }
public function image(){ $files = $_FILES; $cpt = count($_FILES[‘userfile’][‘name’]); for($i=0; $i<$cpt; $i++) { $_FILES[‘userfile’][‘name’]= time().$files[‘userfile’][‘name’][$i]; $_FILES[‘userfile’][‘type’]= $files[‘userfile’][‘type’][$i]; $_FILES[‘userfile’][‘tmp_name’]= $files[‘userfile’][‘tmp_name’][$i]; $_FILES[‘userfile’][‘error’]= $files[‘userfile’][‘error’][$i]; $_FILES[‘userfile’][‘size’]= $files[‘userfile’][‘size’][$i]; $this->upload->initialize($this->set_upload_options()); $this->upload->do_upload(); $fileName = $_FILES[‘userfile’][‘name’]; $images[] = $fileName; } $image = implode(‘,’,$images); $this->image_model->addimages($image); }   Upload an image options public function set_upload_options() { $config = array(); $config[‘upload_path’] = ‘assets/upload/package/’; //give the path …
WordPress is an online, open source website creation tool written in PHP. But in non-geek speak, it’s probably the easiest and most powerful blogging and website content management system (or CMS) in existence today.
PAGE TOP
error

Enjoy this blog? Please spread the word :)

RSS
Follow by Email