bob7l Posted August 8, 2013 Share Posted August 8, 2013 So I've been trying to convert my raw data into easy readable data for awhile now, sadly.. No luck! I'm brand new to php and still trying to learn! $changeString = ""; foreach (explode("@", $fdata) as $change) { $changes = array(); if ($change == "") break; $item = explode("~", $change); $change = $item[1] . "x " . getBlockName($item[0]); if ($change[0] == "+" $changeString .= '<span style="color: green">+(' . trim(implode(", ", $changes)) . ')</span>'; if ($change[0] == "-" $changeString .= '<span style="color: red">-(' . trim(implode(", ", $changes)) . ')</span>'; } $fdata = $changeString; break; Here is the entire file: http://pastebin.com/xXYnF0Ks The raw data looks like "-24:2~1@-21~1@-17:1~1@-17~1@-25~1@-12~1" The "-" sign means something was removed and needs to be red, while the positive sign means something was added. The @ symbol splits each of the item entries up. The ":" symbol sepreates the ID from the dataid, and the ~ sepreates the ID/DataID from the amount. I would love any kind of support! Link to comment https://forums.phpfreaks.com/topic/280953-cant-get-this-working/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.