Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
Hi, I'm a noob when it comes to PHP and I'm learning but I'm stuck so please be kind to me.
I have a PHP dropdown menu that is populating using an array and it's working fine but I'd like to use a regular name as an option instead of the array name.
Here's the code. Could someone please show me how to display "test.php" instead of the path "pagedata/test.php". Thanks
I recommend always using foreach for looping arrays. Much easier, you don't have to count the values or maintain a counter. Also, I don't see any need for that 'end_of_array'.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Thanks for your reply. There's a good reason the "end of array" is there. You're just not seeing all of the code. I have tried learning about associative arrays. Why don't you think the code I provided could use it? Would it really be that hard to add to my existing code?
beazleybub wrote:Thanks for your reply. There's a good reason the "end of array" is there. You're just not seeing all of the code. I have tried learning about associative arrays. Why don't you think the code I provided could use it? Would it really be that hard to add to my existing code?
I didn't say that you're code couldn't use it. I gave an easy fix and also a different way of doing it.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
I was not implying you said an associative array would not work intentionally. When I answered your post I had just waken up and was a bit goofy.
I have seen associative array examples searching the web and investigated their mechanics. I'm just not sure how difficult it would be for me to work it into the code I already have.
Thanks for helping me out. Have a good Easter weekend.