Last active
December 31, 2015 17:49
-
-
Save msjyoo/8023168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string(1) "1" | |
} | |
["markup"]=> | |
string(0) "" | |
["WAPodsubpods"]=> | |
array(1) { | |
[0]=> | |
array(6) { | |
["attributes"]=> | |
array(1) { | |
["title"]=> | |
string(0) "" | |
} | |
["plaintext"]=> | |
string(69) "name | | |
PHP Notice: Undefined index: WAPodsubpods in /home/sekjun9878/GitProjects/WolframAlpha/Example.php on line 22 | |
<?php | |
require_once('wa_wrapper/WolframAlphaEngine.php'); | |
function objectToArray ($object) { | |
if(!is_object($object) && !is_array($object)) | |
return $object; | |
return array_map('objectToArray', (array) $object); | |
} | |
$engine = new WolframAlphaEngine("VUU"); | |
$result = objectToArray($engine->getResults('sekjun9878.info', array('format' => 'plaintext'))); | |
unset($result['rawXML']); | |
$result = array_values($result); | |
//var_dump($result[4]); | |
$output = ""; | |
foreach($result[4] as $value) | |
{ | |
var_dump($value["WAPodsubpods"]); | |
/*$value = array_values($value); | |
var_dump($value[3]); | |
$output .= array_values(array_shift(array_values($value)[3]))[2]." | ";*/ | |
} | |
echo $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment