Category : PHP

80 posts

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.
CodeIgniter is an Application Development Framework – a toolkit – for people who build web sites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple …
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
PAGE TOP
error

Enjoy this blog? Please spread the word :)

RSS
Follow by Email