I'm new to PHP, please help me to split this array. I never do this before.
I only want to show value http://domainXXX.com without string(18) on browser.
array(3) {
[7] => string(18)
"http://domain7.com"
[4] => string(18)
"http://domain4.com"
[3] => string(18)
"http://domain3.com"
}
Assuming the array looks like this, a simple foreach loop
should allow you to output the urls
$links=array(
7 => 'http://domain7.com',
4 => 'http://domain4.com',
3 => 'http://domain3.com'
);
foreach( $links as $key => $url ) {
echo $key,' ',$url,'<br />';
}
don't use direct var_dump()
to display output; you can use foreach()
or any loop and foreach()
has following-
//lets say your array name is $array
// here $key will hold 7,4,3 and $values will hold your domains
foreach($array as $key=>$value)
{
echo $value.'<br>';
}