Has any one got any ideas? I'm really stumped...
:B
Search found 9 matches
- Tue Oct 16, 2007 6:24 pm
- Forum: PHP - Code
- Topic: Accessing arrays with : in their names. How?
- Replies: 8
- Views: 671
- Mon Oct 15, 2007 12:34 am
- Forum: PHP - Code
- Topic: Accessing arrays with : in their names. How?
- Replies: 8
- Views: 671
I've been playing around with this again and still no joy. I have changed my code to the following: <?php $file = $_FILES['userfile']['tmp_name']; $xml_str = file_get_contents ($file); echo 'xml_str: <br><br>'.$xml_str; //============================================== //ITEMS //=====================...
- Mon Aug 20, 2007 12:53 am
- Forum: PHP - Code
- Topic: Accessing arrays with : in their names. How?
- Replies: 8
- Views: 671
It's not accessing the elements that's the problem, it's the way they are named. I have googled and found nothing like this. I have tried: echo $doc->imsmd.':'.lom->CDATA(); echo $doc->imsmd/lom->CDATA(); echo $doc->imsmd./.lom->CDATA(); Each time I get the same error: Parse error: parse error, expe...
- Mon Aug 20, 2007 12:37 am
- Forum: PHP - Code
- Topic: Fatal error: Call to a member function on a non-object...
- Replies: 5
- Views: 454
- Sun Aug 19, 2007 9:17 pm
- Forum: PHP - Code
- Topic: Fatal error: Call to a member function on a non-object...
- Replies: 5
- Views: 454
- Sun Aug 19, 2007 9:08 pm
- Forum: PHP - Code
- Topic: Fatal error: Call to a member function on a non-object...
- Replies: 5
- Views: 454
- Sun Aug 19, 2007 8:51 pm
- Forum: PHP - Code
- Topic: Accessing arrays with : in their names. How?
- Replies: 8
- Views: 671
- Sun Aug 19, 2007 8:49 pm
- Forum: PHP - Code
- Topic: Fatal error: Call to a member function on a non-object...
- Replies: 5
- Views: 454
Fatal error: Call to a member function on a non-object...
I have a piece of php code that looks like this: for($j = 0; $j < $itemCount; $j++){ $item = $doc->menu->section[$i]->item[$j]->attributes(); $itemText = $item['text']; $itemHref = $item['href']; $itemTarget = $item['target']; echo '<a target='.$itemTarget.' href='.$itemHref.'>'.$itemText.'</a></br>...
- Wed Aug 15, 2007 1:14 am
- Forum: PHP - Code
- Topic: Accessing arrays with : in their names. How?
- Replies: 8
- Views: 671
Accessing arrays with : in their names. How?
I have an XML file that contains an element name as follows: <imsmd:langstring>Data in here.</imsmd:langstring> I am using PHP to extract specific elements from the XML file and display them. I am trying the following: echo $doc->imsmd:lom->CDATA(); The parser chokes on the : between imsmd and lom, ...