I'm trying to write a bit of php code to determine if the user is on the checkout page by getting the current url, and the checkout page url, and comparing the two. The comparison is not working though, and I can't understand why.
This php code here:
$courl = Mage::getURL('onestepcheckout');
$cururl = Mage::helper('core/url')->getCurrentUrl();
var_dump($courl);
echo "<br>";
var_dump($cururl);
echo "<br>";
echo "\"$courl\"<br>";
echo "\"$cururl\"<br>";
produces this result:
string(58) "http://127.0.0.1/store/index.php/onestepcheckout/"
string(49) "http://127.0.0.1/store/index.php/onestepcheckout/"
"http://127.0.0.1/store/index.php/onestepcheckout/"
"http://127.0.0.1/store/index.php/onestepcheckout/"
I've tried comparing with ==, ===, and strcmp and none work. I assume this must have something to do with the length discrepancy...
This seems like it must some strange little php nuance I'm not familiar with... I suspected whitespace and tried to trim() both but that didn't have any effect either.
Thanks for any nudges in the right direction! :)