- var_dump: documentation ( source)
- strpos: documentation ( source)
- explode: documentation ( source)
<?php
$category = "112:Category Six:events";
$category_data = explode(':', $category);
if (strpos($category_data[0], '-') !== false) {
$productId = explode('-', $category_data[0]);
var_dump($productId[0]);
var_dump($productId[1]);
}