How to update field value by content type Drupal

Here is the code to update field value by content type Drupal

$query = \Drupal::entityQuery('node')->condition('type', ' dealer_locator')->execute();
$nodes =  \Drupal\node\Entity\Node::loadMultiple($query);
foreach ($nodes as $node) {
$node  =  \Drupal\node\Entity\Node::load($node->nid->valued);
 $field_status=1;
$node->set('field_status',  $field_status);
 $node->save();
}

php stristr

php stristr is one of the most build in library function in PHP, it searches for the first occurrence of a string inside another string and returns the rest of the string from the matching string.

echo stristr(“Good Morning!”,”Morning”);

Output

Morning!

 

echo stristr(“Good Morning! Dear”,”Morning”);

Output

Morning! Dear

 

Return Value: Returns the rest of the string from the matching string.

 

fix phpmyadmin 403 forbidden error in xampp / lampp ubantu

Tp fix phpmyadmin 403 forbidden error in xampp/lampp ubantu Open command prompt using putty

1) move to Lampp config file

# cd /opt/lampp/etc/extra

2) Open Lampp config file “httpd-xampp.conf” using vi editor

# vi  httpd-xampp.conf

change Require local to Require all granted

fix phpmyadmin 403 forbidden error in lampp ubantu

Restart Lampp

#sudo /opt/lampp/lampp restart