What do you want to save?
Add Code snippet
New code examples in category PHP
-
Dylan Siegler 2021-08-27 13:35:01
wordpress show notice
// for success <div class="notice notice-success is-dismissible"> <p><?php _e( 'Done!', 'sample-text-domain' ); ?></p> </div> // for error <div class="notice notice-error is-dismissible "&g... Add solution -
Ma ry 2021-08-27 13:32:02
difference between fetch assoc and fetch array or object php
mysql_fetch_assoc The function returns an associative array of strings that corresponds to the fetched row, or FALSE if there are no more rows. The associativity array tells us about the key value pair, whereas the key tells about any column name and ... Add solution -
Cesar Morais 2021-08-27 13:26:02
php get keys of duplicate values in array
<?php /** Examples of these functions: array_unique, array_diff_assoc, array_diff, array_keys, array_intersect Examle with an array: */ $array = array('a', 'a', 'b', 'c', 'd'); // Unique values $unique = array_unique(... Add solution -
Urnonav 2021-08-27 12:55:01
laravel service example
<?php namespace App\Services; use Illuminate\Support\Collection; use Illuminate\Session\SessionManager; class CartService { const MINIMUM_QUANTITY = 1; const DEFAULT_INSTANCE = 'shopping-cart'; protected $session; protected $instanc... Add solution -
VividD 2021-08-27 12:54:02
What is a Regular Expression in php
<?php // First Verif your regex code with https://regex101.com/ $str = "Visit W3Schools"; $pattern = "/w3schools/i"; echo preg_match($pattern, $str); // Outputs 1 // test email with REGEX if (!preg_match("/[-0-9a-zA-Z.+_]+@[-0... Add solution -