In message <[EMAIL PROTECTED]>, Tedit kap
<[EMAIL PROTECTED]> writes
>Hi,
>The code below, first I get the path of the current page i.e. 
>/home/subpage1/subpage1.php  etc... Then I am trying to explode $a, so that I 
>will have the hom, subpage and subpage1a.php words separately. I read that 
>explode function creates an array such as $aa[0] and $aa[1]...But the problem 
>below is I can not see these in the output. This echo statement outputs 
>nothing. 
>What is the problem below?
>$a= $_SERVER['PHP_SELF' ];
>$aa=explode("/", $a);
>echo $aa[0].$aa[1];

No problems there except that [0] will be empty, as the string contains
nothing before the first '/':
: array = 
  0: string = ""
  1: string = "home"
  2: string = "subpage1"
  3: string = "subpage1.php"

Are you sure that you have something in $_SERVER['PHP_SELF' ]?

I seem to recall that older versions of PHP had different variable
names.


-- 
Pete Clark

Sunny Andalucia
http://hotcosta.com/Andalucia.Spain

Reply via email to