How to check page load time in PHP ?
<?php
$start_time = microtime();
$end_time = microtime();
$load_time = number_format(($end_time - $start_time),3);
echo $load_time;
?>
The industry's top wizards and other experts share their advice and research findings.
<?php
$start_time = microtime();
$end_time = microtime();
$load_time = number_format(($end_time - $start_time),3);
echo $load_time;
?>
$senderId=11;//want to remove this
$list = 4,5,11,22;
$array1 = Array($senderId);
$array2 = explode(',', $list);
$array3 = array_diff($array2, $array1);
$output = implode(',', $array3);//your result 4,5,22
<?php
//Connection with magento2 database
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection('core_read');
//Now execute your mysql query
$fetch="SELECT * FROM catalog_product_entity";
$result = $connection->fetchAll($fetch);
?>
/**Function to encrypt or decrypt the given value**/
/**Create a function for Encryption url**/
function encrypt_decrypt($string){
$string_length=strlen($string);
$encrypted_string="";
for ($position = 0;$position<$string_length;$position++){
$key = (($string_length+$position)+1);
$key = (255+$key) % 255;
$get_char_to_be_encrypted = SUBSTR($string, $position, 1);
$ascii_char = ORD($get_char_to_be_encrypted);
$xored_char = $ascii_char ^ $key; //xor operation
$encrypted_char = CHR($xored_char);
$encrypted_string .= $encrypted_char;
}
/***Return the encrypted/decrypted string***/
return $encrypted_string;
}
/*** While passing the unique value to a link- Do the following steps ***/
$pid=88;//Let's 88 is the actual id
/***For more security multiply some value-You can set the multiplication value in config file*/
$passstring=$pid*12345;
$encrypted_string=encrypt_decrypt($passstring);
$param=urlencode($encrypted_string);
/*** Add this url to your anchor link***/
$url='your_target_path.php?id='.$param;
/*** While fetching the params in the target file- Do the following steps ***/
$getid=$_GET['id'];
$passstring=urldecode(stripslashes($getid));
$decrypted_string= encrypt_decrypt($passstring);
/***Divide the decrypted value with the same value we used for the multiplication***/
$your_actual_id= $decrypted_string/12345;
/*** Now fire your MySql query by this ID***/
Here are the instructions to use Stripe as your payment gateway for your Shopify store:
A- Login to your Shopify store.
B- Click Settings.
C- Click Payments.
D- In the Accept Credit Cards section select Shopify Payments.
E- Deactivate Shopify Payments.(When you deactivate shopify payment after then Stripe payment gateway will show)
F- Now select stripe payment .
G- Click Activate.
H- Click Complete account setup.
I- Enter the various details and submit.
Upon taking the steps above you’ll be able to accept credit card payments and, although Shopify Payments use Stripe, you won’t be able to view your Shopify Payments in the Stripe Dashboard.