What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-25 21:48:10
how to add two array in single array without repetation in php
<?php $array1=array("CPU","Mouse","Monitor"); $array2=array("Key-Board","Monitor","Printer"); $array = array_unique(array_merge($array1, $array2)); print_r($array); ?> Add solution -
PHP 2021-10-11 16:25:08
auto check a category when creating new post
add_filter('wp_terms_checklist_args', 'WPSE_pre_select_categories', 10, 2); function WPSE_pre_select_categories($args, $post_id) { $post = get_post($post_id); // only pre select categories for new posts if ($post->post_status !... Add solution -
PHP 2021-09-22 23:46:03
monday tuesday wednesday => monday - wednesday php
function weekendDaysToString($days, $lang = 'en') { $and = array('pt'=>'e', 'en'=>'and'); $strWeek = array( // config with more langs! 'pt'=>array("Segunda", "Terça", "Quarta", "Quinta... Add solution -
PHP 2021-09-15 23:43:05
array_unique
<?php $input = array("a" => "green", "red", "b" => "green", "blue", "red"); $result = array_unique($input); print_r... Add solution -
Other 2021-09-01 07:50:01
display sequence of days
function weekendDaysToString($days, $lang = 'en') { $and = array('pt'=>'e', 'en'=>'and'); $strWeek = array( // config with more langs! 'pt'=>array("Segunda", "Terça", "Quarta", "Quinta... Add solution -
PHP 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