Concatenate multiple strings with separator using MySQL

Concatenate multiple strings with separator using MySQL

Concatenate multiple strings with separator using MySQL To Concatenate multiple strings with separator in MySQL we can use MySQL CONCAT_WS() function. MySQL CONCAT_WS() function is used to join two or more strings with separator. The separator itself can be a string. If the separator is NULL the result is NULL. Syntax : CONCAT_WS (separator, string1, string2,…) Code : SELECT CONCAT_WS(',','1st string','2nd string'); Share this: Facebook Twitter Google Email LinkedIn Pinterest Pocket Share this:FacebookTwitterGoogleEmailLinkedInPinterestPocket

Read More
0
Share

How to show user information like IP address, useragent using PHP

show user information like IP address, useragent using PHP

How to show user information like IP address, useragent using PHP Nowadays we can see most of the sites sharing(showing) user information like “You are logged in from ip : 192.1468.1.2″. Also the browser which we are using and device. In this tutorial lets see how we can retrieve those information using php. Using php retrieving user information like this is pretty much easier than anyother programming. The php $_SERVER variable contains all these informations when a user access the…

Read More
0
Share

How to get latitude and longitude from address using php

show user information like IP address, useragent using PHP

How to get latitude and longitude from address using php In this tutorial we are goint to see how we can get latitude and longitude from address using php and google map api. To get latitude and longitude you can use the following gmap api. http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=$region So with the use of gmap api and php file_get_contents() function we can get the latitude and longitude. Use the following code snippet to get it, $address = str_replace(" ", "+", $address); $region=str_replace(" ","+",$region…

Read More
0
Share

How to convert values in an array to lowercase in php

show user information like IP address, useragent using PHP

How to convert values in an array to lowercase in php To convert all the values in an array to lowercase we can use php array_map() function. array_map — Applies the callback to the elements of the given arrays Syntax: array array_map ( callable $callback , array $array1 [, array $... ] ) array_map() returns an array containing all the elements of array1 after applying the callback function to each one. The number of parameters that the callback function accepts…

Read More
0
Share

How to export data to csv using php?

show user information like IP address, useragent using PHP

How to export data to csv using php How to export data to csv using php? Nowadays many programmers use csv to export data’s for various purpose. In this tutorial we are going to see how to export data to csv file using php. And also we are going to see how to download the generated csv file. In creating the csv file the fputcsv() function plays the main role. Let’s proceed with the following code, The code can be…

Read More
0
Share

How to assign rendered view to a variable in CodeIgniter

assign rendered view to a variable in CodeIgniter

How to assign rendered view to a variable in CodeIgniter Is some instance we need to generate some blocks and show it in the pages. In such cases we need to assign some views to variables and pass it to the current page view in order to echo those blocks. To do this we can use the following syntax in codeigniter, $a = $this->load->view('theview',$data,true); theview - template name $data - template variables boolean - to render or to assign the…

Read More
0
Share