Re: Function Parameter converted from string to array when passed
| From: | Christopher William Wesley | Date: | Tue, 06 Nov 2001 00:04:38 +0000 |
| Subject: | Re: Function Parameter converted from string to array when passed | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73527@lists.php.net to get a copy of this message | ||
> require_once("./library/gui_coding.php");
Does the gui_coding.php file reassign $current_page to some array value?
(The above line is suspect, as it's the only thing in between your
assignment, and the output that might affect $current_page's value.)
~Chris /"\
\ / September 11, 2001
X We Are All New Yorkers
/ \ rm -rf /bin/laden
On Mon, 5 Nov 2001, Michael Motal wrote:
> Ok, I've tried finding the answer online but have had no luck. I have a
> main page with this snippet of code:
>
> <?php
> $current_page = substr($PHP_SELF,5);
> echo("BEGIN MAIN Current Page: " . $current_page . "<BR>");
> require_once("./library/gui_coding.php");
> $filename = "./includes/top_banner.html";
> $top_banner = (fread(@fopen($filename, "r"),filesize($filename)));
> $menu_html = create_menu($current_page); # strip off the leading /dev/
> of the page name
> ...
>
> which calls the create_menu function with a STRING parameter $current_page.
> However, when the function gets it, it is suddenly an ARRAY. A sample of the
> output:
>
> BEGIN MAIN Current Page: main.html
> BEGIN create_menu with current_page=Array
> Begin getItemMenuLevel with site= stryxus current_item= Array
> ...
>
> I've tried settype() and cast and in both instances it still was interpreted
> by the called function as an array.
>
> How can I force the parameter to be passed as a STRING instead of being
> converted to an ARRAY?