upload file base64 encoded

if(!empty($_POST)){ if(!empty($_FILES)){ //–on upload file (image) get details & encoding base64 :Starts–    $file_name = $_FILES[‘file’][‘name’];     $file_size= $_FILES[‘file’][‘size’];     $file_tmp= $_FILES[‘file’][‘tmp_name’];     $file_ext = strtolower( end(explode(‘.’,$file_name)));     $file_type = pathinfo($file_name, PATHINFO_EXTENSION);     $file_data = file_get_contents($file_tmp);     $data_base64 = ‘data:image/’ . $file_type . ‘;base64,’ . base64_encode($file_data);     //–on upload(image) get details & encoding base64: Ends –    … Read moreupload file base64 encoded

Convert stdClass object to array in PHP

#Convert stdClass object to array in PHP The easiest way is to JSON-encode your object and then decode it back to an array: $array = json_decode(json_encode($object), True); Or if you prefer, you can traverse the object manually, too: foreach ($object as $value)  $array[] = $value->post_id;

Which Version of Codeigniter I am using?

#Which version of CodeIgniter am I currently using? Ans: Yes, the constant CI_VERSION will give you the current CodeIgniter version number. CodeIgniter 2, it’s defined in /system/core/CodeIgniter.php For example, echo CI_VERSION; // echoes something like 2.2.1 check the file system/core/CodeIgniter.php

Whether we can have a form inside another form?

#Whether we can have a form inside another form? Though you can have several <form> elements in one HTML page, you cannot nest them. We can not use <form> elements like this way. Example, <form name=’form1′> <form name=’form2′> //some code here </form> </form>