![]() Not just the base array(the associative one) but alos all the arrays inside it. I somehow need to declare the whole structure of $typedict as global. $typedict seems to be only visible inside the IF block since the last value is okay if chekcked inside the block. We can push one or more than one element into the array and these elements gets inserted to the end of the array and because of the pushed elements into the array, the length of the array also gets incremented by the number of elements pushed. But i have no clue how this could happen and therefore can't fix it: This inbuilt function of PHP is used to push new elements into an array. So in this case $current contains the string "whatever" and not "value". $current is the index of $typedict not any of it's contents. ![]() My goal is an array inside each entry of the associative array $typedict.Įxample: $typedict = "value" I do not want to change whatever is in $current as it behaves excactly as i want. As seen in the code i check it pretty much everytime it gets set. $elementDefs = $xpath->evaluate("/xs:schema/xs:complexType") ĮchoElements("", $elementDef, "xs:sequence/xs:element", $typedict) $elementDefs = $xpath->evaluate("/xs:schema/xs:element") ĮchoElements("", $elementDef, "xs:complexType/xs:sequence/xs:element", $typedict) $elementDefs = $xpath->evaluate($evaluate, $elementDef) ĮchoElements($indent. $type = $elementDef->getAttribute('name') $attribute_name = $elementDef->getAttribute('name') $elementDef->getAttribute('maxOccurs')įunction echoElements($indent = "", $elementDef, $evaluate, &$typedict) $current įull code: loadXML(mb_convert_encoding($xsdstring, 'utf-8', mb_detect_encoding($xsdstring))) įunction outputFormat($indent, $elementDef)Įcho "". Also the var $current as stated always have the correct content. Since the print chelc at the end states " => Array()" i have no clue what could be the problem as this indicates that they are indeed arrays and therefore could have stuff pushed in. I print the current associative index out with echo to confirm that it is the correct one(it always is). Array_push($typedict, "value") ĭoes not seem to do anything here, i output the associative array of arrays($typedict) but all of them are empty(array()).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |