Quote:
Originally Posted by thunder99
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