What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-11-16 11:52:29
store emoji in php
use utf8mb4 (charset) for store emoji in php database Add solution -
PHP 2021-11-15 18:55:21
php nested ternary operator
// The below statement is an exaple of the nested ternary operator in PHP echo ($row["position"] != "NA") ? $row["position"] : (($row["current_degree"] != "NA") ? $row["current_degree"] : $row... Add solution -
Other 2021-11-12 21:43:20
increase PHP Memory
/* To increase the PHP memory limit setting, edit your PHP.ini file found under /usr/local/etc/php/7.4/. Increase the default value (example: Maximum amount of memory a script may consume = 128MB) of the PHP memory limit line in php.ini. */ memory_limit ... Add solution -
PHP 2021-11-12 03:53:11
get ip address of client php
The simplest way to collect the Client/Visitor IP address using PHP is the REMOTE_ADDR. Pass the 'REMOTE_ADDR' in PHP $_SERVER variable. It will return the IP address of the visitor who is currently viewing the webpage. Get the IP address of the website ... Add solution -
PHP 2021-11-11 00:05:12
print asociative array php
<?php /* There are 3 Types of array in php 1. Indexed arrays - Arrays with a numeric index 2. Associative arrays - Arrays with named keys 3. Multidimensional arrays - Arrays containing one or more arrays This is the second one - Associative arrays... Add solution -
PHP 2021-11-10 03:53:14
array_merge_recursive in php
// array_merge_recursive function in php <?php $a1=array(color=>"red","green"); $a2=array(color=>"blue","yellow"); print_r(array_merge_recursive($a1,$a2)); ?> //OUTPUT Array ( [color] => Array ( [0]... Add solution -
PHP 2021-11-09 14:40:13
php date timestamp now
//Get current date time in PHP // Simply: $date = date('Y-m-d H:i:s'); // Or: $date = date('Y/m/d H:i:s'); // This would return the date in the following formats respectively: $date = '2012-03-06 17:33:07'; // Or $date = '2012/03/06 17:33:07'; /** *... Add solution -
PHP 2021-11-09 09:01:10
Associative array in php
<?php /* There are 3 Types of array in php 1. Indexed arrays - Arrays with a numeric index 2. Associative arrays - Arrays with named keys 3. Multidimensional arrays - Arrays containing one or more arrays This is the second one - Associative arrays... Add solution -
PHP 2021-11-08 13:13:11
ob_start in php
//why use ob_start() in php <?php ob_start(); //Start remembering everything that would normally be outputted, but don't quite do anything with it yet $output = ob_get_contents(); //Gives whatever has been "saved" ob_end_clean(); //Stops sav... Add solution -
PHP 2021-11-07 22:10:17
php cors header multiple domains
//Function to be called first in php file. function CORS_HEADERS_HANDLER(){ if (isset($_SERVER['HTTP_ORIGIN'])){ switch($_SERVER['HTTP_ORIGIN']){ //Handle an IP address and Port case 'http://1.2.3.4:4200': header('Access-Contro... Add solution