CODE:
<?php
/*** remove key and data from associative array PHP */
$studentInfo =["name"=>"Tomy Jason","age"=>45,"sex"=>"Male"];
print_r($studentInfo);
unset($studentInfo["sex"]);
echo "<br>";
print_r($studentInfo);
?>
Simple Web Development tips & spiritual observations
CODE:
<?php
/*** remove key and data from associative array PHP */
$studentInfo =["name"=>"Tomy Jason","age"=>45,"sex"=>"Male"];
print_r($studentInfo);
unset($studentInfo["sex"]);
echo "<br>";
print_r($studentInfo);
?>
Code:
<?php
$customer= [
"name"=>"Tommy Jason",
"age" => 45,
"sex" => "Male",
"location" => "USA"
];
print_r($customer);
echo "Serialized: <br>";
$serializedCustomer =serialize($customer);
echo $serializedCustomer;
echo "<br>";
echo "Unserialized: <br>";
$unserializedCustomer =unserialize($serializedCustomer);
print_r($unserializedCustomer);
echo "<br>";
echo "JSon Encoded<br>";
echo $jsonEncoded = json_encode($customer);
echo "<br>";
echo "Json Decoded --converted to object <br>";
$jsonDecoded= json_decode($jsonEncoded);
print_r($jsonDecoded);
echo "<br>Json Decoded --converted to Array <br>";
$jsonDecoded= json_decode($jsonEncoded,true);
print_r($jsonDecoded);
echo "<br>";
?>
Code:
<?php
$students=[
'12'=>'Tom',
'13'=>'Shib',
'14'=>[
'12'=>'Tom Spanish',
'13'=>'Shib Spanish'
]
];
var_dump($students);
echo "<br>";
print_r($students);
echo "<br>";
echo $students["14"]["13"];
echo "<br>";
$food=array(
"vegetables" => "tomato,potato",
"frutis" => "apple, banana",
"drinks" => array(
"soft"=>"coke,fanta",
"beverage" => "x,y,z",
)
);
print_r($food);
echo "<br>";
echo $food["drinks"]["soft"];
?>

If you are using both the W3 Total Cache and WP Touch Pro plugins for optimizing your site’s performance and mobile view respectively, you may encounter a conflict where WP Touch Pro stops displaying the mobile view and instead shows the cached desktop version.
Here is the Solution
Continue reading “Resolving WP Touch Pro Mobile View Conflict with W3 Total Cache: Fixing Desktop Cache Display Issue”
If you are using Smart Theme V3 by Optimizepress and you are searching to add some basic social icons at the end of blog post ( which you edited using Optimizepress builder), then use the code i shared here. It will be looked like this ( almost similar)

Sapor is a free wordpress theme which you can use for your cooking or gardening or healthy living blog site. Here I am sharing you css customization which you can use to customize or style it if you want to use the theme.
Sapor Theme Demo to get idea how it looks
Continue reading “WordPress free theme for cooking or gardening or healthy living : Modification and Make your site live”
The Default font which shows in Visual Editor font size dropdown is 8px 10px 12px 14px 16px 20px 24px 28px 32px 36px 48px 60px 72px 96px.
Continue reading “Add additional font size in WordPress Visual Editor ( Tiny MCE Editor)”** This contents are collected from my Guru’s (Deepanshu Giri) facebook page Lunarastro . The post is written by Nitin Bhatt . So these contents are for learning and research purpose only. I will gradually Update it.
As we know in astrology Mercury is communication and 8th house is Death. So Mercury in 8th is the bearer of the bad news. Native may have committed sin of giving someone bad news just for joke, as 8th house is death, breaks and mercury represents communication, humour, so in this life also native will get habit of uncontrollable laugh, miscommunication at wrong time and even speaking Ill of the dead.
That is why writing obituary for ancestors and write and communicate good things about them will ward off negative energy of the Mercury in the 8th house.
Also Mercury in 8th house shows incomplete rituals of death in family.
Here I am sharing you template file and the related functions.php file code to register a wordpress user ( user role is Editor)
The template is doing the following to register a new wordpress user
Generally , due to this code $wp_query->set(‘author’, $current_user->ID); the custom fields of Advanced Custom Fields ( acf ) got hidden. So i have used this following code to solve the issue. So if you use this code in function.php or using code snippet plugins, Author can see only his uploaded images instead of all users image.
function restrict_author_media_library($wp_query) {
if ( $wp_query->get('post_type') == 'attachment' && current_user_can('author')) {
$current_user = wp_get_current_user();
$wp_query->set('author', $current_user->ID);
}
}
add_action('pre_get_posts', 'restrict_author_media_library');