Tutorials
Category
26 posts found
Define array to for shuffle keys [php]$numbers = array( ‘one’ => ‘one_1′ ,’two’ => ‘two_2′ ,’three’ => ‘three_3′ ,’four’ => ‘four_4′ ,’five’ => ‘five_5′ ,’six’ => ‘six_6′ ,’seven’ => ‘seven_7′ ,’eight’ => ‘eight_8′ ,’nine’ => ‘nine_9′ ,’ten’ => ‘ten_10’ ); [/php] Define array indexes to get random keys in while
Post in
[php] $numbers = array( ‘one’ => ‘one’ ,’two’ => ‘two’ ,’three’ => ‘three’ ,’four’ => ‘four’ ,’five’ => ‘five’ ,’six’ => ‘six’ ,’seven’ => ‘seven’ ,’eight’ => ‘eight’ ,’nine’ => ‘nine’ ,’ten’ => ‘ten’ ); foreach($numbers as $num_key=>$num_val){ $array_keys[$num_key] =$num_key; } //RESULT Array ( [one] => one [two] => two
Post in
Its hard to test your small code or function on files, because these serve our time to open files and write code save with die or exit in the file and then go to browser for testing, or we go to online php testing tools, but online php testing tools
Sometimes we want call a function if user pressed two keys together at the same time. Like Shift+Enter, CTRL+S more others, I wrote a little code how to call a function if user pressed two keys. copy keys name from another post to use easily with key names. [javascript] var
Post in
1.Remove duplicate values from array – ARRAY_UNIQUE [php] $array = array(0,1,2,3,3,4,5,5,7,8,7,7); $array = array_unique($array); [/php] Result [php] Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [5] => 4 [6] => 5 [8] => 7 [9] => 8 ) [/php] 2.Re-order with random values from
Post in
I have a array that contains continent and with countries. [php] Array ( [0] => Array ( [continent_name] => asia [country_name] => pakistan [country_value] => 1 ) [1] => Array ( [continent_name] => asia [country_name] => india [country_value] => 2 ) [2] => Array ( [continent_name] => asia [country_name] =>
Post in
make $wpdb global variable [php] global $wpdb; //NOW GET YOUR WORDPRESS DATABASE TABLE PREFIX $prefix = $wpdb->base_prefix; ///`WP_` IS DEFAULT PREFIX [/php
Post in
Many times we need to store #array in #database with because may we don’t want to create all specified fields with names in #database table, so we just inserted, and here is example that I want to save whole #array data in database table field mysql. [php] $save_array = array(
Post in
I was also faced that problem the unchecked checkboxes cannot submit the data when submit form, so I decided to a write a jquery, here is my html [html] <input type="checkbox" value="1" checked="checked" named="checked_checkbox" /> <input type="checkbox" value="1" named="un_checked_checkbox" /> [/html] When I using print_r($_POST) ; its just return [php]
this function allow you to generate random characters code,function suitable for Generate activation code for newly user account Generate shortenURL code, Generate temporary user password for changing password of account. [php] function generate_special_pass($pass_len = 8, $allow_special_chrs = true) { $allow_chrs = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz’; $special_chrs = ‘!@#$%^&*()_+’; if($allow_special_chrs) { $pass_chrs = $allow_chrs.$special_chrs;
Post in
TOP COMMENTED
laravel remove public from url
This is weird thing from #laravel on fresh installation, so…
3 comments
Pakistani Web Designer’s Web Designing…
Web Design Illustrations - IdealHut.com by Design-Maker…
2 comments
MEASURE UNITS PX, CM, IN, MM CONVERSION…
[php]function measure_conversation($value = null, $measurein = null, $returnin = 'px',…
2 comments
28 Android IOS Mobile Application Frameworks
jQuery Mobile Ionic: Advanced HTML5 Hybrid Mobile App Framework Mobile…
2 comments
20 jQuery HTML5 Video Player for Website
Video.js The Player Framework MediaElement.js - HTML5 video player Create…
2 comments