Jump to content

Can't get this working


bob7l

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.