Hi guys, having trouble splitting some items up in PHP. The list below is a small extract of over 1000 items. ITEM1¬a/item1.html ITEM2¬a/item2.html ITEM3¬a/item3.html I added the ¬ as an identifier where to split I need them to split like: $item $url So far I managed: $url = file_get_html('pasteitems.php'); $pieces = explode(".html", $url); foreach ($pieces as $piece) { echo "$piece<br>"; } PHP: That split them into: ITEM1¬a/item1 ITEM2¬a/item2 ITEM3¬a/item3 But I'm stuck how to have them as 2 variables Please help! And then enter into a db
$url = file_get_html('pasteitems.php'); $pieces = explode(".html", $url); $final = preg_split("/^ITEM[0-9]/", $piece); foreach ($pieces as $piece) { echo "$piece<br>"; } PHP: $final[0] = ITEM1 $final[1] = a/item1 Should work. Untested and in a rush. Let me know how it goes.