Category : PHP


How to find day from specific date in PHP?

Whenever you need to det day like Monday, Tuesday etc from full date. i mean you have any specific date like "2015-10-10" and you want to get day then you can do in both way first using strtotime() and second using DateTime object. In Following example you can see i give you both way to get day from your date. now i added format 'l' so it will return full name of day like "Tuesday", but if you want to get short name of day then you can change format like "D". <pre class="language-php"> // Using strtotime() $specificDate = strtotime('2016-2-3'); $specificDate = date('l', $specificDate); var_d.....

By Hardik Savani | February 3, 2016 | | 692 Viewer | Category : PHP
READ MORE

How to check empty or null in Mysql Query?

If you want to check empty or null value with conditional statement like case when and if in table row with Mysql database. you like to check empty or null value form table then you have multiple way check that. first we check empty value with case when statement then following example. <strong>Empty Check:</strong> <pre class="language-mysql"> SELECT (CASE WHEN COALESCE(email,'')!='' THEN email ELSE 'example@gmail.com' END) as test FROM `customers` ---------------------OR---------------------- SELECT (CASE COALESCE(email,'') WHEN '' THEN 'example@gmail.com' ELSE email END) as test FR.....

By Hardik Savani | January 31, 2016 | | 850 Viewer | Category : PHP
READ MORE

How to copy one table data into another table using Mysql Query?

If you are working on php or any php framwork and you want to copy one table into other table by using sql query, so you could do it using simple SELECT and INSERT statement. just you need to think how you can use. In Following example you can see how to fetch data from "post" table and how to insert into "post_copy" table, so basically you have to select field of one that you want to copy and second one give name of table with proper field that you want insert. But don't forgot to give a name of field otherwise it generate error. <pre class="language-mysql"> INSERT INTO `post_copy` (name,sl.....

By Hardik Savani | January 30, 2016 | | 1609 Viewer | Category : PHP
READ MORE

How to remove null values from array in PHP?

you have array with null value and you want to remove all null value from that array without loop. you can remove your all null value from array without loop. PHP array_filter function through you can remove all null value, you see following example how to remove null value : <strong>Example:</strong> <pre class="language-php"> $example = array(100, "hardik", null, "hey", NULL, "", 77); $result = array_filter($example, function($value) { return !is_null($value); }); print_r($result); </pre> <strong>Output:</strong> <pre>Array ( [0] => 100 [1] => hardik [3] => hey [5.....

By Hardik Savani | January 28, 2016 | | 1925 Viewer | Category : PHP
READ MORE

How to Solve overwrite index.php in windows wampserver ?

Many time you have face a problem in windows wampserver or virtualhost of index.php file overwrite. i also fetch that problem like: http://localhost/test/index.php/admin In this url you can see index.php wtite in url, but URL must be without index.php. so if you are using windows wampserver then you can easily solve out this problem by folowing step: <strong>1. Open File : </strong>C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf <strong>2. Find : </strong> #LoadModule rewrite_module modules/mod_rewrite.so and Then, Just Change, Only remove ‘#’ sign. <pre> #LoadModule rewrite_module mo.....

By Hardik Savani | January 23, 2016 | | 1109 Viewer | Category : PHP
READ MORE

How can make an array from the values of another array's key?

If you are working on PHP or other PHP framework and you want to create array of another array value. now you can see on following example how can you make array form another multidimensional array key's. For example you have array like: <pre class="language-php"> $multi = array( ['1'] => array('id'=>1,'name'=>'hardik'), ['2'] => array('id'=>1,'name'=>'vimal'), ['3'] => array('id'=>1,'name'=>'harshad'), ) </pre> but if you want to this multi-dimensional array just like this way: <pre class="language-php"> $test = array('hardik','vimal','harshad'); </pre> so, we can make t.....

By Hardik Savani | January 21, 2016 | | 568 Viewer | Category : PHP
READ MORE

How to merge two array with same keys without loop in PHP ?

you want to merge two array but without overwrite value then you can see how to merge two array in following example.you have two array and you want to merge with overwrite with key then you fetch many problem. like this two array : <strong>My Array:</strong> <pre class="language-php"> $array1 = [ '0'=> ['name'=>'Hardik','Surname'=>'Savani'], '1'=> ['name'=>'Harsukh','Surname'=>'Makawana'], ]; $array2 = [ '0'=> ['name1'=>'Harshad','Surname1'=>'Pathak'], '1'=> ['name1'=>'Vimal','Surname1'=>'Kashiyani'], ]; </pre> AND You want.....

By Hardik Savani | January 21, 2016 | | 885 Viewer | Category : PHP
READ MORE

How to count unique domains from email address field in MySQL ?

you want to count domain from your email address field in mysql. if you are working on PHP then you could do easily by using explode function and counting domains, but that way is a very bad logic and it take max time on execution when you have lot of data. But we can do easily in MySQL by using SUBSTRING_INDEX(). SUBSTRING_INDEX() take a three arguments string, delimeter and number.string is a source of string, the delimeter to search for in the string and the number parameter will search for delimeter.If pass negative in third argument then it will everything from the left of the targeted .....

By Hardik Savani | January 14, 2016 | | 700 Viewer | Category : PHP
READ MORE

How to create responsive menu in html/PHP ?

Now i am going to show how to create responsive menu in your html website. i will show you how to create responsive menu using css, html and jquery. we have to also use media query. it is a pretty simple to create responsive menu. now i listed two file one is html and second is css file this two file make a simple responsive menu and you can easy to change and modification in in this file. it will easy to integrate with php, .net or any php framework. how to create a responsive menu bar in html, responsive menu bar jquery example, responsive menu using css and jquery, responsive menu with css.....

By Hardik Savani | January 9, 2016 | | 923 Viewer | Category : PHP
READ MORE

How to add ckeditor with image upload in Laravel ?

if you want to use ckeditor in laravel and you also want to add file uploading as well. if you are use simply in php then it is very simple. but if you are set laravel then you fetch many problem like i also fetch lots of problem. Now, i will give you few step to set ckeditor with file uploading and you will easily apply this. this is a very simple to browse your image, file etc upload. use ckeditor in php, use ckeditor in laravel 4, use ckeditor in laravel 5, how to add ckeditor in laravel, laravel ckeditor image upload, laravel ckeditor example, laravel ckeditor sample, ckeditor laravel 4,.....

By Hardik Savani | January 8, 2016 | | 9624 Viewer | Category : PHP
READ MORE

    Laravel 5 - Custom Helper Facade Class Example from scratch

    Laravel 5 - Custom Helper Facade Class Example from scratch

    Open Post

    How to add CKEditor with image upload using KCFinder in PHP Example Code?

    How to add CKEditor with image upload using KCFinder in PHP Example Code?

    Open Post

    Laravel 5 login with Linkedin using Socialite Package

    Laravel 5 login with Linkedin using Socialite Package

    Open Post

    Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin

    Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin

    Open Post

    How to make read more link from string in PHP?

    How to make read more link from string in PHP?

    Open Post

    How to install laravel framework on windows xampp server from scratch?

    How to install laravel framework on windows xampp server from scratch?

    Open Post