Loop problem
Posted: Sat Sep 06, 2008 7:15 pm
Hi All
I have any array dynamic which contain values string,I want to get each value from array one by one outside the loop how can i do this.
<?php
$docroot=shell_exec('grep ^DocumentRoot /etc/httpd/conf.d/*.conf|cut -d" " -f2| uniq');
$docroot=str_replace('"', "", $docroot);
$docroot = explode("\n",$docroot);
print_r ($docroot);
$mast=count($docroot);
$mast=$mast-1;
for ($i = 0; $i < $mast; ++$i) {
print_r ($docroot[$i]);
}
I have any array dynamic which contain values string,I want to get each value from array one by one outside the loop how can i do this.
<?php
$docroot=shell_exec('grep ^DocumentRoot /etc/httpd/conf.d/*.conf|cut -d" " -f2| uniq');
$docroot=str_replace('"', "", $docroot);
$docroot = explode("\n",$docroot);
print_r ($docroot);
$mast=count($docroot);
$mast=$mast-1;
for ($i = 0; $i < $mast; ++$i) {
print_r ($docroot[$i]);
}