Detect is your website is access from Mobile and Device

This is very simple and useful tip to detect that your user is using Android or iOs device to log in to your website in CakePHP 3 it is even easier CakePHP 3 device detection 

Core PHP

Hope this tip help you. If this code help you plz like and share this with other

Round off decimal to nearest highest value

If you wan’t to round off decimal value to nearest heights value you can use bellow code

Output of above code Input value 44.61 Output: 44.65 Input value 44.68 Output: 44.70 Hope this will help you 🙂

Redirect HTTP to HTTPS in Cakephp3

If you are building CakePHP application and want to move all traffic to HTTPS you can follow bellow simple steps without making any change in .htaccess  file Step 1. Edit AppController to make change

Step 2. Load security component

Step 3. Create function which redirects all non https request to https

Hope […]

PHP function to generate Slug

Here is simple function to generate slug in php. You can copy paste this function and generate slug by passing string in it.

🙂

Send email in cakephp 3

If you are working with cakephp 3 and need to send email then this tip help you to send email. Step 1. Go to your app.php and find EmailTransport and add your SMTP details

Step 2. Now we can include cakephp default mailer class to send email

And after this we can create email object […]

Enable Debug Kit in Cakephp 3

This tip help you enable your Cakephp 3 debug kit follow below simple steps to enable your debug kit. Enable Debug Kit in Cakephp 3 Step 1. Open terminal and run following command, before enter below command go to root directory of your project 

Step 2. After this debug kit is download and run this command […]

Simple pagination for your web api or web services

We all know about pagination and where we use :-p but if you are developing web api or web services in php here is a simple and easy way to create pagination.

hope this help you 🙂

Add Gist in your wordpress blog post

If you have blog and that blog focus on programming language then you need some plugin to add your code in that post so that your code look as same as they look in your code editor with proper color and format etc. , but plugin slow down your site because they contain more javascript files and we […]