Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created October 27, 2011 20:57
Show Gist options
  • Save jehoshua02/1320846 to your computer and use it in GitHub Desktop.
Save jehoshua02/1320846 to your computer and use it in GitHub Desktop.
Disecting the product color attribute to get the color code
<?php
$string = 'Black-BLK';
$separator = '-';
// here's what I got!
$code = implode($separator, array_slice(explode($separator, $string), 1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment