Hacktor Posted May 13, 2011 Share Posted May 13, 2011 function hookExtraLeft($params) { global $cookie, $link, $smarty; /* Product informations */ $product = new Product(intval(Tools::getValue('id_product')), false, intval($cookie->id_lang)); $productLink = $link->getProductLink($product->id, $product->link_rewrite); $smarty->assign('productLink', parse_url($productLink,PHP_URL_QUERY)); // $productLink = preg_replace("/[^\/]*$/","",$productLink); $productLink = preg_replace("#^[^:/.]*[:/]+#i","",$productLink); print_r($productLink); $smarty->assign(array( 'this_path' => $this_path, 'product' => $product, 'productLink' => $productLink )); {l s='Email dit artikel aan vriend(in)' mod='sendtoafriend'} Geeft als resultaat:http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product='>http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product=http://www.tweewielersite.nl/tweewielersite/102-sparta-e-motion-damesfiets.htmlMAAR dit moet zijn:http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product='>http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product=102-sparta-e-motion-damesfiets.htmlKan iemand mij helpen met de juiste preg_replace code svp????THX Link to comment Share on other sites More sharing options...
Hacktor Posted May 14, 2011 Author Share Posted May 14, 2011 Probleem opgelost....$productLink = preg_replace("/(http:\/\/)www.tweewielersite.nl\/tweewielersite\/+/i","",$productLink); Link to comment Share on other sites More sharing options...
Recommended Posts