Position Data Formatter
Formatted Data:';
echo '
' . htmlspecialchars($formattedData) . '
';
}
function formatData($inputData) {
// Split the input data into lines
$lines = explode("\n", $inputData);
$formattedData = '';
foreach ($lines as $line) {
// Check for lines containing "Position:"
if (strpos($line, "Position:") !== false) {
// Extract and format the position values
preg_match('/<(.+?)>/', $line, $matches);
$position = explode(", ", $matches[1]);
$x = isset($position[0]) ? floatval($position[0]) : '';
$y = isset($position[1]) ? floatval($position[1]) : '';
$z = isset($position[2]) ? floatval($position[2]) : '';
$formattedData .= '