Get text between HTML tags – PHP

function getTextBetweenHtmlTags($string, $tagname) {    $pattern = “/<$tagname>(.*?)</$tagname>/”;    preg_match($pattern, $string, $matches);    return $matches[1]; }function truncate_str($str, $maxlen) {    if (strlen($str) <= $maxlen) {       return $str;    }      $newstr =…

Continue Reading →

Posted in: PHP

Woocommerce custom checkout

global $woocommerce; $items = $woocommerce->cart->get_cart(); $data = $_REQUEST; $payment_first_name = $data[‘payment_first_name’]; $payment_last_name = $data[‘payment_last_name’]; $billing_adress_same = $data[‘billing_adress_same’]; $billing_address = $data[‘billing_address’];…

Continue Reading →