Showing posts with label Php. Show all posts
Showing posts with label Php. Show all posts

Monday, April 17, 2017

Install Ratchet in ubuntu using composer in ubuntu 16.04 LTS

 
 
 
For this tutorial, I will be installed in my laravel project.

1) Navigate to your laravel project

2) Open terminal and write this 

sudo composer require cboden/ratchet

3) Finish installing then type this 

sudo composer install 

4) Ratchet should be installed and you should good to go. :)

More Info, visit here Install Ratchet Command in Ubuntu
 

Wednesday, April 5, 2017

Install Ratchet in ubuntu using composer in ubuntu 16.04 LTS

 
 
 
For this tutorial, I will be installed in my laravel project.

1) Navigate to your laravel project

2) Open terminal and write this 

sudo composer require cboden/ratchet

3) Finish installing then type this 

sudo composer install 

4) Ratchet should be installed and you should good to go. :)

More Info, visit here Install Ratchet Command in Ubuntu
 

Monday, March 20, 2017

Easily check apache version in xampp (Window)




Xampp is a famous window software that has been around for quite some time and it is widely used all over the world. The reason why it widely used is because of it simplicity on combining php and mysql together without the need to install them one by one which is kind of a headache.

Check apache version in xampp is easy, all you have to do is navigate to bin folder.

cd/xampp/apache/bin

and type

httpd -v 

And you should be able to see the apache version

 


If you are facing any problem on this, don't hesitate to message at Obstrum facebook page.

Hope this tutorial will help those in need.

If you want to get in touch with more tutorial, add me on google+ or like and follow our facebook page for more! Obstrum Facebook Page

Saturday, December 17, 2016

Generate a unique id in PHP



Generate a unique id is common knowledge to know especially for the beginners. People always use unique id for security purpose like email verification, username verification and others. In this page, I will teach you on how to create a unique id in PHP.

This is the code to generate unique id.



You can test it by simply run the code below.



You should be able to see id format like this.

If you are facing any problem on this, don't hesitate to message at Obstrum facebook page.

Hope this tutorial will help those in need.

If you want to get in touch with more tutorial, add me on google+ or like and follow our facebook page for more! Obstrum Facebook Page 

Monday, October 31, 2016

Unzip Archive in php



Alright so you already archive or zip your big files. Then you wonder how to unzip it?Using same php library ZIP ARCHIVE, you can unzip it. How difficulty is it? It simple like eating a cake.

Below is the source code:



'ppap.zip' is the destination and files name. Change it according to path that you want.

ex. C:/Users/Ben/Desktop/ppap.zip

$zip->extractTo('path/to/output');

If you think that this tutorial help you, please share it around! thanks!

Create zip file using php



Nowadays people always archive their big files. The reasons are to save spaces perhaps in their portable hard disk or computer storage. If you are a php developer, this is a must function that a customer will always request. But is it difficult to create a zip file in php? It's actually easier than you thought!

To make things simple, this is the function to create zip files.



Note that files are array type, you can insert as many files as you want as long as it within array.
Ex.
1) single file 

$files_to_zip = array('path/to/file');

2) multiple file

$files_to_zip = array('path/to/file', 'path/to/file', 'path/to/file');

Here how to run the function:

create_zip($files_to_zip,'path/for/output');

Overwrite is set to FALSE. If you wish to have the ability to overwrite existing file, set it to TRUE.



Friday, October 28, 2016

Get first and last day in month using php





First day of month



Last day of month



How to use (for beginner)?

ex. firstDay(11, 2016)  // 2016-11-01
ex. lastday(11, 2016) // 2016-11-30


Source : Get first and last day in month using php