Jump to content

The bits of an array surrounded by " " marks


hugeness

Recommended Posts

Hello... tearing my hair out trying to extract the contents of an array that looks a bit like this:

 

a:2:{i:0;s:5:"Spec1";i:1;s:5:"Spec6";} 

 

an array being carried over as the variable $ts7

 

its being sent by a wonderfully useful jquery selection list, but i dont know how to get the actual variables out of it.. in this case Spec1 and Spec6.

 

have tried variations along the lines of

 

<?php

if (preg_match("/"./"", $ts7, $ts7)) {

  echo "Match was found <br />";

  echo $ts7[0];

}

 

but to no avail..

any pointers gratefully received.. i'm rubbish at these but keen to improve, so any links to useful tutorials/sites also great would be!

Theoretically to match those values you'd use something more like...

 

'

#"[^"]+"#'

 

But I suspect there is a better method, whilst I don't recognise that format it seems very specific, it could be JSON or something similar.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.