Jump to content

forestpest

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

forestpest's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. solved!!!!! sorry I feel dumb it must be because I haven't been sleeping
  2. Ok I was able to make the device send me the url without the + signs. url is created from a mobile device so it neeeded re-programming but still input in browser is http://secreturl?message=55901392696301120081019194525fs-0.1,0.2,-4.3,5.1,-5.5,ff,000000000000000 output is offset until zeros =15 length = 72 $message = 55901392696301120081019194525fs-0.1,0.2,-4.3,5.1,-5.5,ff,000000000000000 data = -0.1,0.2,-4.3,5 where's the rest until before the 1st zeero?
  3. <?php $message = $_GET['message']; //get message if(!isset($message)) //if message vraiable empty { echo 'wrong'; } else { //get message length $l = strlen($message); //find where ending zeros are $findme = '000000000000000'; $pos_zeros = stripos($message, $findme); if ($pos_zeros === false) { echo "The string '$findme' was not found in the string '$message'"; } $id = substr($message,0,15); //get id $year = substr($message,15,4); $month = substr($message,19,2); $day = substr($message,21,2); $hours = substr($message,23,2); $minutes = substr($message,25,2); $seconds = substr($message,27,2); $found_fs = substr($message,29,2); $fs = "fs"; $offset_until_zeros = ($l - $pos_zeros); echo 'offset until zeros =' . $offset_until_zeros; $data = substr($message,31,$offset_until_zeros); $ff = "ff"; echo 'length = ' . $l; echo $message; echo $data; } ?> input in browser is link_not_shown because it's an active url so please excuse?message=55901392696301120081019194525fs-0.1,+0.2,-4.3,+5.1,-5.5,ff,000000000000000 output is as follows offset until zeros =15 length = 74 message becomes 55901392696301120081019194525fs-0.1, 0.2,-4.3, 5.1,-5.5,ff,000000000000000 (plus signs are gone why?) $data = -0.1, 0.2,-4.3, where are the rest until the before the first 0? I should get $data = -0.1,+0.2,-4.3,+5.1,-5.5,ff, what is happening??????
  4. looks good thanks I had something similar at first but I messed up. one question though how am i sure that after the fs I have only floats and not anything else? am I missing something?
  5. Hi all things have changed just a bit but still I can't get around this the correct format must be as follows 15 digits then 8 for date like yyyymmdd then fs,y,y,y,ff where fs = start point for first set of data that consists of y = float number like +1.0,-2.0 and ends with ff then 15 zeros that means we have reached the end of the data Can you help me out on this? is RE the right why to go since i don't know the length of the message i will be receiving? Sample Data ========== message=55901392696301120081019194525fs-0.1,+0.2,-4.3,+5.1,ff,000000000000000 15 digits = 559013926963011 date = 20081019 (yesterday) time = 194525 (19:45:25) then fs and the data = -0.1,+0.2,-4.3,+5.1 where number delimeter is . and data delimeter is ,them ff then 15 zeros.
  6. Sorry for replying my own message just missing a comma in the format. Correct format is fs,x,y,x,y,x,y,ff,vs,x,y,x,y,x,y,vf
  7. Hi all I need to check a variable is in the correct format say it called $message the correct format must be as follows 15 digits then 8 for date like yyyymmdd then fs,x,y,x,y,x,y,ff,vs x,y,x,y,x,y,vf where fs = start point for first set of data that consists of x,y = float numbers likes 1.0,2.0 and ends with ff then vs = start point for second set of data that consists of x,y = float numbers likes 1.0,2.0 and ends with vf then 15 zeros that means we have reached the end of the data Can you help me out on this? is RE the right why to go since i don't know the length of the message i will be receiving?
×
×
  • 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.