Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Transform any string to url-like string in Magento (useful for dynamic CSS classes for example)
<?php
$string = 'My String';
$urlKeyString = Mage::getSingleton('catalog/product')->formatUrlKey($string);
// Returns => my-string
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment