View Single Post
Old 06-30-2011, 06:22 AM  
Dido
Confirmed User
 
Dido's Avatar
 
Industry Role:
Join Date: Sep 2006
Location: Netherlands
Posts: 217
Quote:
Originally Posted by thunder99 View Post
I know there's an easy way of doing this, but I'm having a brain freeze.

I want to extract the domain name from this array value

a:1:{s:10:"formfield1";s:17:"www.domain.com";}

Anybody know how?
This is the way a serialized() array looks like in PHP.
So I guess you could just unserialize() it and then extract $foo['formfield'], which should yield 'www.domain.com'...

[edit]
After actually checking if it would work, I noticed your original isn't formatted properly... the second part claims it's going to contain a string of 17 characters when it's only a 14 character one... so this exact example won't work, but the original of 'www.domain.com' would probably work just fine :P
__________________
Dido

ADAMO Advertising - Your ULTIMATE traffic partner!

If you need traffic or have traffic, we'd love to help you make the best out of it!

ICQ:24209500 - Skype:diederikvanschaik

Last edited by Dido; 06-30-2011 at 06:27 AM..
Dido is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote