Hey everyone, I'm VERY new to php, only started learning a couple of days ago.
Basically, I'm trying to write a script to convert Co-ordinates in the form 'a! b! c!' into '20+a! 20+b! 20+c!'. I've managed to figure out how to do one line, but am completely stumped upon trying to work out the next line. I've done a basic HTML textarea form being processed to the .php file, with these variables:
$origdata = $_POST['origdata'];
$origdata = preg_replace('/(\\s){2,}/', '$1', $origdata);
Followed by:
$pieces = explode(" ", $origdata);
echo 20 + $pieces[0].'!'.' ';
echo 20 + $pieces[1].'!'.' ';
echo 20 + $pieces[2].'!'.' ';
Which basically turns, for example, '-719.473! 257.075! 10.105!' into '-699.473! 277.075! 30.105!'.
Any help would be appreciated, thanks. Here is a screenshot of my progress, so you should be able to get the general idea, because I'm really bad at explaining things.
http://i44.photobucket.com/albums/f3/venomxsigs/inputoutput.png