Page 1 of 1

help help help :)

Posted: Mon Oct 31, 2005 12:53 pm
by raver
hello to all...i`m new here ..someone just recommended this forum saying that there are nice people here that will help me in my problem...so here it goes :)
To make a long story short i work for a gsm website and for 8 hours a day i copy information about mobile phones and put them in out own database...so i thought it may be possible to write a script which can copy the information and store them in some variables with which i can put them in the DB.
So for example i am copyying from the following table:

Network GSM 900 / GSM 1800 / GSM 1900
Announced 2005, October
Status Coming Soon
Dimensions 105 x 46 x 18 mm
Weight 95 g
Display Type TFT, 65K colors
Size 132 x 176 pixels
etc etc etc
I would like to extract just the GSM 900 / GSM 1800 / GSM 1900 :2005, October, Coming soon etc etc etc and put them in variables. So far i found out i can save the page with fopen in a variable and someone suggested i use regex. I`ve looked at some regex tutorials and got completly lost :)
I don`t know..i hope someone can help me pls?
Thanks anyway for reading this :)

Posted: Mon Oct 31, 2005 1:16 pm
by feyd
file_get_contents() would be a slightly better route to storing the page request results.. As for the regex you'll need to use preg_match or a sibling. I'd suggest downloading Regex Coach and play around with trying to extract the data with that, as it can show you what will be found (generally) in realtime. We've got many quite well explained regex pattern set ups and a walkthrough in the regex board here...

Moved to Regex.

Posted: Mon Oct 31, 2005 1:21 pm
by raver
i was hoping it could be accomplished easier then with regex...someone told me it could be done with strpos and substr ..but i`m quite a newbie...if i could find an example code i could manage the rest but i didn`t find zip on the net about what i need...i`ll try that program in the mean time and thanks alot for it...in the mean time..if someone has another suggestion...one more easy i would be thankfull :)

Posted: Mon Oct 31, 2005 1:56 pm
by Burrito
the problem with using strpos and substr etc is that they wont' take into account a variable length nor variable valued string.

If you knew the values were going to fall within certain parameters every time, then yes, you could use strpos, substr, strlen etc. However, my guess is that this will be pretty dynamic in which case you're going to need to extract the data with a much more robust technique than those can offer. Regex is the tool to use.

We can certainly offer regex help if you need it. I'd say create your own pattern first (after reading the regex "tutorial" at the top of this forum), and then post it up here. We can then help you fine-tune and get it working the way you want.

Posted: Mon Oct 31, 2005 2:18 pm
by raver
ok i just got an ideea....sorry if it may seem stupid :D
from what i got out of the tutorial i got that ^ means the start and $ the end of the expression. I was thinking...could i maybe do something like mark the start as ^network and finnish at the first $</td> it encountered?
and then somehow separate the network and the bit of information i require?
for example if i have <td>network</td><td>GSM900/GSM1800</td> somehow i could get the gsm part out of context?
i await your reply...and sorry again if it was a dumb question :)

Posted: Mon Oct 31, 2005 2:37 pm
by Chris Corbyn
raver wrote:ok i just got an ideea....sorry if it may seem stupid :D
from what i got out of the tutorial i got that ^ means the start and $ the end of the expression. I was thinking...could i maybe do something like mark the start as ^network and finnish at the first $</td> it encountered?
and then somehow separate the network and the bit of information i require?
for example if i have <td>network</td><td>GSM900/GSM1800</td> somehow i could get the gsm part out of context?
i await your reply...and sorry again if it was a dumb question :)
You sure can.

If you post a copy of the HTML source (the specific chunk) you need to extract info from we can see how tricky it would be. From what I'm seeing this should, to someone with a little more than basic regex knowledge, be fairly easy. And saves a lot of work for you I guess :P

Posted: Mon Oct 31, 2005 2:41 pm
by Burrito
well you probably don't want to match the begin and end of your string per se.

let's say you have the string that you posted "<td>network</td><td>GSM900/GSM1800</td>" and you want to match what is between the second cell identifiers. You could do something like this:

Code: Select all

$string = "<td>network</td><td>GSM900/GSM1800</td>";
preg_match("/<td>network<\/td><td>(.*?)<\/td>/i",$string,$matches);
echo $matches[1];
I'm definitely not a pro at regex but that should work for that case. You'll probably want to end up making more "useable" by allowing it to search multiple contexts rather than hard coding them into your pattern like I've done above.

Posted: Tue Nov 01, 2005 12:53 am
by raver
here is what the table looks like:

Code: Select all

<table cellspacing="0">
<tr>
<th rowspan="3" scope="row">General</th>
<td class="ttl"><a href=# onClick="helpW('h_ntype.htm');">Network</a></td>
<td class="nfo">GSM 900 / GSM 1800 / GSM 1900</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_year.htm');">Announced</a></td>
<td class="nfo">2005, October</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_status.htm');">Status</a></td>
<td class="nfo">Coming Soon</td>
</tr>
</table><table cellspacing="0">
<tr>
<th rowspan="2" scope="row">Size</th>
<td class="ttl"><a href=# onClick="helpW('h_dimens.htm');">Dimensions</a></td>
<td class="nfo">105 x 46 x 18 mm</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_weight.htm');">Weight</a></td>
<td class="nfo">95 g</td>
</tr>
</table><table cellspacing="0">
<tr>
<th rowspan="2" scope="row">Display</th>
<td class="ttl"><a href=# onClick="helpW('h_dtype.htm');">Type</a></td>
<td class="nfo">TFT, 65K colors</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_dsize.htm');">Size</a></td>
<td class="nfo">132 x 176 pixels</td>
</tr>
		

</table><table cellspacing="0">
<tr>
<th rowspan="3" scope="row">Ringtones</th>
<td class="ttl"><a href=# onClick="helpW('h_ringtype.htm');">Type</a></td>
<td class="nfo">Polyphonic</td>
	</tr>
	
 
	
<tr><td class="ttl"><a href=# onClick="helpW('h_ringcustom.htm');">Customization</a></td>
<td class="nfo">Download</td></tr>

<tr>
<td class="ttl"><a href=# onClick="helpW('h_vibrat.htm');">Vibration</a> </td>
<td class="nfo">Yes</td>
</tr>
	
</table><table cellspacing="0">
<tr>
<th rowspan="3" scope="row">Memory</th>
<td class="ttl"><a href=# onClick="helpW('h_number.htm');">Phonebook</a></td>
<td class="nfo">1000 x 20 fields, Photo call</td>
</tr>
<tr>
<td class="ttl"><a href=# onClick="helpW('h_callr.htm');">Call records</a></td>
<td class="nfo">10 dialed, 10 received, 10 missed calls</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_cslot.htm');">Card slot</a></td>

<td class="nfo">No	
		
</td>
</tr>
</table><table cellspacing="0">
<tr>
<th rowspan="10" scope="row">Features</th>
 
<td class="ttl"><a href=# onClick="helpW('h_gprs.htm');">GPRS</a></td>
<td class="nfo">Class 10 (4+1/3+2 slots)</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_datas.htm');">Data speed</a></td>
<td class="nfo">32 - 48 kbps</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_messg.htm');">Messaging</a></td>
<td class="nfo">SMS, MMS, Email, Instant Messaging</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_clock.htm');">Clock</a></td>
<td class="nfo">Yes</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_alarm.htm');">Alarm</a></td>
<td class="nfo">Yes</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_infrar.htm');">Infrared port</a></td>
<td class="nfo">Yes</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_games.htm');">Games</a></td>
<td class="nfo">Yes + downloadable</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_colors.htm');">Colors</a></td>
<td class="nfo">Amazon Green, Atlas Grey</td>
</tr>
 	
<tr>
<td class="ttl"><a href=# onClick="helpW('h_camera.htm');">Camera</a></td>
<td class="nfo">VGA, 640x480 pixels, video</td>
</tr>
 
<tr><td class="ttl">&nbsp;</td><td class="nfo">- Resistance to water, shock and dust<br />
- Java<br />
- WAP 2.0<br />
- T9<br />
- Currency converter<br />
- Calculator<br />
- Stopwatch<br />
- Organizer<br />
- Voice memo<br />
- User profiles<br />
- SyncML<br />
- Build-in handsfree<br />
- External flash as accessory<br />
- USB port</td></tr>
	

</table><table cellspacing="0">
<tr>
<th rowspan="3" scope="row">Battery</th>
<td class="ttl">&nbsp;</td>
<td class="nfo">Standard battery, Li-Ion</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_standb.htm');">Stand-by</a></td>
<td class="nfo">Up to 450 h</td>
</tr><tr>
<td class="ttl"><a href=# onClick="helpW('h_talkta.htm');">Talk time</a></td>
<td class="nfo">Up to 8 h</td>
</tr>
	
</table>
and here is the direct link so you can see how the table looks like...
http://gsmarena.com/siemens_me75-1324.php

Posted: Tue Nov 01, 2005 3:43 am
by Jenk
This will need some work, but it's a start :)

Code: Select all

<?php

$string = file_get_contents('location/url of table file');

preg_match_all('/<td[^<>]*?>([^<>]+)<\/td>/i', $string, $match);

var_dump($match[1]);

?>
Outputs:

Code: Select all

array(26) {
  [0]=>
  string(29) "GSM 900 / GSM 1800 / GSM 1900"
  [1]=>
  string(13) "2005, October"
  [2]=>
  string(11) "Coming Soon"
  [3]=>
  string(16) "105 x 46 x 18 mm"
  [4]=>
  string(4) "95 g"
  [5]=>
  string(15) "TFT, 65K colors"
  [6]=>
  string(16) "132 x 176 pixels"
  [7]=>
  string(10) "Polyphonic"
  [8]=>
  string(8) "Download"
  [9]=>
  string(3) "Yes"
  [10]=>
  string(28) "1000 x 20 fields, Photo call"
  [11]=>
  string(15) "No   
      
"
  [12]=>
  string(24) "Class 10 (4+1/3+2 slots)"
  [13]=>
  string(12) "32 - 48 kbps"
  [14]=>
  string(34) "SMS, MMS, Email, Instant Messaging"
  [15]=>
  string(3) "Yes"
  [16]=>
  string(3) "Yes"
  [17]=>
  string(3) "Yes"
  [18]=>
  string(18) "Yes + downloadable"
  [19]=>
  string(24) "Amazon Green, Atlas Grey"
  [20]=>
  string(26) "VGA, 640x480 pixels, video"
  [21]=>
  string(6) "&nbsp;"
  [22]=>
  string(6) "&nbsp;"
  [23]=>
  string(24) "Standard battery, Li-Ion"
  [24]=>
  string(11) "Up to 450 h"
  [25]=>
  string(9) "Up to 8 h"
}

Posted: Tue Nov 01, 2005 7:43 am
by raver
Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


wow that code really is great  i still can`t believe how small and effective it is....
thanks alot....but i don`t understand why i can`t do the following:

Code: Select all

<?php
include ('db.php');
$url=$_POST['url'];
$string = file_get_contents($url);

preg_match_all('/<td[^<>]*?>([^<>]+)<\/td>/i', $string, $match);

var_dump($match[1]);

//putting the output in an array
$var=$match[1]; 
//echoing some results to see if it works
echo "$var[0], $var[1], $var[2], $var[3]"; //passed
//trying to insert values in database
$query="INSERT INTO test VALUES ($var[0], $var[1], $var[2])"; //failed
$result=mysql_query($query) or die("I couldn`t insert the data");

?>
when i try to insert them in a test database all i get is the DIE message :) and i`m too young for that.


Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Tue Nov 01, 2005 7:53 am
by Jenk
change the die() to

Code: Select all

die('Insert error: ' . mysql_error());
That'll give a more descirptive error message :)

Posted: Tue Nov 01, 2005 4:03 pm
by raver
ooops stupid mistake...forgot some ' ' around the variables in the insert statement...
I must say this script is great, i`ve managed to get the information and put it in the database....but there is just one problem with it unfortunatly...the script takes the strings it encounters and places them one after the other in the array. But there are some pieces of information i don`t need and which are not on every page so they will be inserted in the wrong category. All i`m interested is in the line of information ...here..let me show you an example:

Code: Select all

Type	                               Polyphonic (64 channels)	
Customization	             Download	
Vibration 	                      Yes	
 	                               - Dual speakers
Phonebook	                       Yes, Photo call
I`m interested in getting just Polyphonic (64 channels) , Download, Yes, Yes, Photo call part. The -Dual speakers is there just for that phone in particular and it brakes all of the content which is to be inserted. I don`t know..i hope this can be accomplished somehow? I`m thinking of a regex which will take out information only if in the first td there is some information and extract everything that resides after that cell but ending before the next one? like 1<td>Customization 2<td>Download
Hope i`m not too much of a bother to you :)

Posted: Wed Nov 02, 2005 7:52 am
by yum-jelly
I would not use a regex for this. Why? Because you don't know if a certain data type will be included in the document. So you will end up with data not being where it should in the resulting array returned by the regex! example

Say.... (Vibration) is missing, you would end up with

Code: Select all

[0] => Array
        (
            [Type] => Polyphonic
            [Customization] => Download
            [Vibration] => 1000 x 20 fields, Photo call
            [Phonebook] => Polyphonic
        )
The more results you have in the page means more and more bad resulting data! This is where a loop control is needed because you need to control...

1. what to find
2. limit each result set
3. if all data is not found still set the array element so your db insert maintains all the fields it's expecting!


Sure it more work to write, but it's complete control over just a guessing type control!

this is untested, but based on your data it will do what you want, plus it will handle multi result sets that could be in each page!

The results should look like this... ( where empty values, means the data was not found)

Code: Select all

Array
(
    [0] => Array
        (
            [Type] => Polyphonic
            [Customization] => Download
            [Vibration] => Yes
            [Phonebook] => 1000 x 20 fields, Photo call
        )

    [1] => Array
        (
            [Type] => Polyphonic
            [Customization] => 
            [Vibration] => Yes
            [Phonebook] => 1000 x 20 fields, Photo call
        )

    [2] => Array
        (
            [Type] => Polyphonic
            [Customization] => Download
            [Vibration] => 
            [Phonebook] => 1000 x 20 fields, Photo call
        )

)

// script...

Code: Select all

<?

// file to read or url...

$out = file_get_contents ( 'url_or_file_path_plus_name' );

// the data holder

$keep = array ();

// what to look for (start at, stop at)

$data = array ( 
'h_ringtype.htm' => 'Type', 
'h_ringcustom.htm' => 'Customization', 
'h_vibrat.htm' => 'Vibration', 
'h_number.htm' => 'Phonebook'
);

// split the page, because each data we are looking
// for is contained in a <tr>data</tr>

$split = '<tr>';

$parts = explode ( $split, $out );

// the resulting data array increment counter

$na = 0;

for ( $i = 0; $i < sizeof ( $parts ); $i++ )
{
	foreach ( $data AS $k => $v )
	{
		// if we find exactly what we want, grab it, clean it, set it and break until the next match
		// we use (2) test patterns because some data on the page might match (1) of the match
		// patterns, but the bogus data will never match both of are testing patterns!

		if ( strpos ( $parts[$i], $k ) !== false && strpos ( $parts[$i], $v ) !== false )
		{
			// each result set start, we add a new array, we do it this way to catch
			// the last result without having to repeat code blocks! In other words
			// it is to handle multi result sets found in a page...

			if ( isset ( $keep[$na][$v] ) && $v = 'Type' )
			{
				$na++;
			}

			// the cleaner, just get the data we want

			$temp = substr ( $parts[$i], strpos ( $parts[$i], $k ) );
			$temp = substr ( $temp, ( strpos ( $temp, $v ) + strlen ( $v ) ) );
			$temp = strip_tags ( $temp );

			// fix up any line breaks and cut out extra spaces

			$old = array ( '#\\r?\\n#', '#\\s+#' );
			$new = array ( ' ', ' ' );
			$keep[$na][$v] = trim ( preg_replace ( $old, $new, $temp ) );

			// done, exist the foreach()

			break;
		}
	}
}

// fix all the unset elements, we can't add this to
// the first loop because we would not catch the
// last array on multi result page, which would
// mean you would have to write this twice. So in
// this case it better to leave it here...

for ( $i = 0; $i < sizeof ( $keep ); $i++ )
{
	if ( ! isset ( $keep[$i]['Type'] ) )
	{
		$keep[$i]['Type'] = '';
	}
	if ( ! isset ( $keep[$i]['Customization'] ) )
	{
		$keep[$i]['Customization'] = '';
	}
	if ( ! isset ( $keep[$i]['Vibration'] ) )
	{
		$keep[$i]['Vibration'] = '';
	}
	if ( ! isset ( $keep[$i]['Phonebook'] ) )
	{
		$keep[$i]['Phonebook'] = '';
	}
}

// just show the resulting array

print_r ( $keep );

?>

yj

Posted: Thu Nov 03, 2005 3:17 am
by raver
well this is going great :) except one thing....here is the completion of yum-jelly`s code:

Code: Select all

<? 
// file to read or url... 
$url=$_POST['url'];
$out = file_get_contents ( $url ); 

// the data holder 

$keep = array (); 

// what to look for (start at, stop at) 

$data = array ( 
'h_ntype.htm' => 'Network',
'h_year.htm' => 'Announced',
'h_status.htm' => 'Status',
'h_dimens.htm' => 'Dimensions',
'h_weight.htm' => 'Weight',
'h_dtype.htm' => 'Type',
'h_dsize.htm' => 'Size',
'h_ringtype.htm' => 'Type', 
'h_ringcustom.htm' => 'Customization', 
'h_vibrat.htm' => 'Vibration', 
'h_number.htm' => 'Phonebook',
'h_callr.htm' => 'Call records',
'h_cslot.htm' => 'Card slot',
'h_gprs.htm' => 'GPRS',
'h_messg.htm' => 'Messaging',
'h_infrar.htm' => 'Infrared',
'h_camera.htm' => 'Camera',
'h_standb.htm' => 'Stand-by',
'h_talkta.htm' => 'Talk-time'
); 

// split the page, because each data we are looking 
// for is contained in a <tr>data</tr> 

$split = '<tr>'; 

$parts = explode ( $split, $out ); 

// the resulting data array increment counter 

$na = 0; 

for ( $i = 0; $i < sizeof ( $parts ); $i++ ) 
{ 
    foreach ( $data AS $k => $v ) 
    { 
        // if we find exactly what we want, grab it, clean it, set it and break until the next match 
        // we use (2) test patterns because some data on the page might match (1) of the match 
        // patterns, but the bogus data will never match both of are testing patterns! 

        if ( strpos ( $parts[$i], $k ) !== false && strpos ( $parts[$i], $v ) !== false ) 
        { 
            // each result set start, we add a new array, we do it this way to catch 
            // the last result without having to repeat code blocks! In other words 
            // it is to handle multi result sets found in a page... 

            if ( isset ( $keep[$na][$v] ) && $v = 'Network' ) 
            { 
                $na++; 
            } 

            // the cleaner, just get the data we want 

            $temp = substr ( $parts[$i], strpos ( $parts[$i], $k ) ); 
            $temp = substr ( $temp, ( strpos ( $temp, $v ) + strlen ( $v ) ) ); 
            $temp = strip_tags ( $temp ); 

            // fix up any line breaks and cut out extra spaces 

            $old = array ( '#\\r?\\n#', '#\\s+#' ); 
            $new = array ( ' ', ' ' ); 
            $keep[$na][$v] = trim ( preg_replace ( $old, $new, $temp ) ); 

            // done, exist the foreach() 

            break; 
        } 
    } 
} 

// fix all the unset elements, we can't add this to 
// the first loop because we would not catch the 
// last array on multi result page, which would 
// mean you would have to write this twice. So in 
// this case it better to leave it here... 

for ( $i = 0; $i < sizeof ( $keep ); $i++ ) 
{ 
	if ( ! isset ( $keep[$i]['Network'] ) ) 
    { 
        $keep[$i]['Network'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Announced'] ) ) 
    { 
        $keep[$i]['Announced'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Status'] ) ) 
    { 
        $keep[$i]['Status'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Dimensions'] ) ) 
    { 
        $keep[$i]['Dimensions'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Weight'] ) ) 
    { 
        $keep[$i]['Weight'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Type'] ) ) 
    { 
        $keep[$i]['Type'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Size'] ) ) 
    { 
        $keep[$i]['Size'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Type'] ) ) 
    { 
        $keep[$i]['Type'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Customization'] ) ) 
    { 
        $keep[$i]['Customization'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Vibration'] ) ) 
    { 
        $keep[$i]['Vibration'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Phonebook'] ) ) 
    { 
        $keep[$i]['Phonebook'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Call records'] ) ) 
    { 
        $keep[$i]['Call records'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Card slot'] ) ) 
    { 
        $keep[$i]['Card slot'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['GPRS'] ) ) 
    { 
        $keep[$i]['GPRS'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Messaging'] ) ) 
    { 
        $keep[$i]['Messaging'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Infrared'] ) ) 
    { 
        $keep[$i]['Infrared'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Camera'] ) ) 
    { 
        $keep[$i]['Camera'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Stand-by'] ) ) 
    { 
        $keep[$i]['Stand-by'] = ''; 
    } 
    if ( ! isset ( $keep[$i]['Talk-time'] ) ) 
    { 
        $keep[$i]['Talk-time'] = ''; 
    } 
} 

// just show the resulting array 

print_r ( $keep ); 
?>
When trying his code the output was as expected, but when i tried the full code(and i hope i didn`t make any mistakes) i got this output:

Code: Select all

Array ( [0] => Array ( [Network] => GSM 900 / GSM 1800 / GSM 1900 [Announced] => 2005, 1Q [Status] => Coming Soon [Dimensions] => 96 x 48.5 x 26.5 mm [Weight] =>   [Type] => TFT, 256K colors [Size] => 320 x 240 pixels [Customization] => [Vibration] => [Phonebook] => [Call records] => [Card slot] => [GPRS] => [Messaging] => [Infrared] => [Camera] => [Stand-by] => [Talk-time] => ) [1] => Array ( [Network] => ype.htm');">Type Polyphonic (64 channels) [Customization] => Download [Vibration] => Yes [Phonebook] => Yes, Photo call [Call records] => 20 dialed, 20 received, 20 missed calls [Card slot] => microSD (TransFlash) [GPRS] => Class 10 (4+1/3+2 slots) [Messaging] => SMS, MMS, EMail [Infrared] => port Yes [Camera] => 3 MP, 2048 x 1536 pixels, video, flash [Stand-by] => [Announced] => [Status] => [Dimensions] => [Weight] => [Type] => [Size] => [Talk-time] => ) )
As you can see the output is a little strange...as it is divided into two arrays...strangest thing i`ve ever seen :) i was thinking it is probably because "Type" occurs twice on the page ? any ideeas?