st852 Posted August 22, 2017 Report Posted August 22, 2017 (edited) How to read "rawdata" data Edited August 22, 2017 by st852 Quote
Guest lorathon Posted August 22, 2017 Report Posted August 22, 2017 $res = @unserialize($pirep->rawdata); if (is_array($pirep->rawdata['points'])) { foreach($pirep->rawdata['points'] as $point) { $altitude = $point['alt']; $groudspeed = $point['gs']; } } Hope this helps. Quote
RuiMiguel Posted September 8, 2017 Report Posted September 8, 2017 Hello works but instead of appearing the altitude appears the numbers of points '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '3', '9', '11', '9', '5', '141', '241', '244', '244', '246', '246', '246', '246', '244', '246', '246', '244', '241', '237', '229', '103', '93', '73', '25', '5', '9', '0', '0', '0', '0', '0', Quote
Guest lorathon Posted September 8, 2017 Report Posted September 8, 2017 The code I wrote does not echo anything. So you will need to place your code here so that I can see it and determine what the issue is. Quote
RuiMiguel Posted September 8, 2017 Report Posted September 8, 2017 <script type="text/javascript"> Highcharts.chart('container', { chart: { type: 'line' }, title: { text: 'Altitude' }, xAxis: { categories: [<?php $res = @unserialize($pirep->rawdata); if (is_array($pirep->rawdata["points"])){ foreach ($pirep->rawdata['points'] as $point) { ?> '<?php echo $altitude = $point['alt'] ?>', <?php } }?>] }, yAxis: { title: { text: 'Altitude' } }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: false } }, series: [{ name: 'Altitude', data: [<?php $res = @unserialize($pirep->rawdata); if (is_array($pirep->rawdata["points"])){ foreach ($pirep->rawdata['points'] as $point) { ?> '<?php echo $altitude = $point['alt'] ?>', <?php } }?>] }] }); </script> Quote
Guest lorathon Posted September 8, 2017 Report Posted September 8, 2017 You have <?php echo $altitude = $point['alt'] ?> Try <?php echo floatval($point['alt']) ?> Quote
Yash Posted December 27, 2017 Report Posted December 27, 2017 Can you share the full code please? Not working for me Quote
Guest lorathon Posted December 28, 2017 Report Posted December 28, 2017 This only works for a custom kACARS. If you do not have this then there will not be anything in the rawdata field. Quote
Yash Posted December 28, 2017 Report Posted December 28, 2017 Yeah I have rawdata in mysql database with all the details. Just need the code.. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.