Skip to main content

Posts

Multidimensional Array Searching - Find key by specific value

Solution is based on the array_search() function. You need to use PHP 5.5.0 or higher. $userdb=Array ( (0) => Array     (         (uid) => '100',         (name) => 'Sandra Shush',         (url) => 'urlof100'     ), (1) => Array     (         (uid) => '5465',         (name) => 'Stefanie Mcmohn',         (pic_square) => 'urlof100'     ), (2) => Array     (         (uid) => '40489',         (name) => 'Michael',         (pic_square) => 'urlof40489'     ) ); Solution-1: function myfunction($products, $field, $value) {    foreach($products as $key ...

What is an earthquake?

Earthquakes with magnitude of about 2.0 or less are usually called microearthquakes; they are not commonly felt by people and are generally recorded only on local seismographs. Events with magnitudes of about 4.5 or greater - there are several thousand such shocks annually - are strong enough to be recorded by sensitive seismographs all over the world. Great earthquakes, such as the 1964 Good Friday earthquake in Alaska, have magnitudes of 8.0 or higher. On the average, one earthquake of such size occurs somewhere in the world each year. Magnitude measures the energy released at the source of the earthquake as determined from measurements on seismographs. An earthquake has one magnitude. The magnitude scale most commonly in use now is called the moment magnitude scale. Moment is a physical quantity proportional to the slip on the fault times the area of the fault surface that slips; it is related to the total energy released in the EQ. The moment magnitude p...

MySQL Database Table Prefix Explained: How to Change It in Minutes

How to Change a MySQL Database’s Table Prefix: A Step-by-Step Guide Introduction Changing the table prefix of a MySQL database is a common task for enhancing security or reorganizing database structures. This guide walks you through the process step by step, ensuring clarity and efficiency. Whether you're a developer or a site administrator, these instructions will help you tackle the task with confidence. Why Change Your Table Prefix? Enhanced Security : Default table prefixes, like wp_ in WordPress, are often targeted by attackers. Changing them can reduce vulnerabilities. Customization : A new prefix makes your database easier to identify in complex environments. Avoid Conflicts : Helps prevent issues when importing databases into shared environments. Changing a database table prefix is easy and here’s the simple step-by-step guide! For WordPress installations, it’s essential! How to change a prefix 1. In your text editor, change database_name, old_prefix_ and new_prefix_ to ...