General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 6th, 2002, 06:50 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
cool function

hey, ive just been developing my site, and ive made a handy function which is good for displaying all the names/values of a array.

PHP Code:
function ShowArray($array)
        {
        
            foreach(
$array as $key=>$value)
                {
                
                    if(
is_array($value))
                        {
                            echo 
"<blockquote><strong>$key</strong><br>";
                            
ShowArray($value);
                            echo 
'</blockquote>';                        
                        }
                    else
                        {
                        
                            echo 
"<strong>$key</strong>: $value<br>\n";
                        
                        }
                
                }
        
        } 


Call the function with the supected array file, it will repeat itsself for multi dimentional arrays so you could call it like

ShowArray($_POST);


this would show all the submitted values from the previous page.

Reply With Quote
  #2  
Old November 6th, 2002, 06:58 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 50 sec
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
hey, thats pretty cool. that would be helpful to debug scripts to check if its actually sending the POST information to the next page.

good job [insert thumbs up emoticon here]
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
  #3  
Old November 6th, 2002, 08:50 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
cool, but print_r() does something similar
__________________
Best Regards,
Håvard Lindset

Reply With Quote
  #4  
Old November 6th, 2002, 12:55 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
Quote:
hey, thats pretty cool. that would be helpful to debug scripts to check if its actually sending the POST information to the next page.

That is what var_dump() is for.....
__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
  #5  
Old November 6th, 2002, 08:13 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
oh ****e, oh well

Reply With Quote
  #6  
Old November 6th, 2002, 10:44 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
Hey Ben - if you feel like writing an article, I can send you a very usefull breadcrumb function to write an article around - very popular as alot of people are wondering how to create this type of navigation system....

Just let me know, I will send you the function....

Reply With Quote
  #7  
Old November 7th, 2002, 02:10 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Quote:
Originally posted by jpenn
Hey Ben - if you feel like writing an article, I can send you a very usefull breadcrumb function to write an article around - very popular as alot of people are wondering how to create this type of navigation system....

Just let me know, I will send you the function....


it would be cool to see how you did it, and see if it's anything like the way I did it.. maybe you can pm me the function?

Reply With Quote
  #8  
Old November 7th, 2002, 02:16 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
NP - I will prep it and pass it along to you. Give me a bit to break it out of our CMS package and I will PM it to you...

Reply With Quote
  #9  
Old November 7th, 2002, 05:16 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Quote:
Originally posted by jpenn
NP - I will prep it and pass it along to you. Give me a bit to break it out of our CMS package and I will PM it to you...


great, thanks btw, what kind of site is that site in your sig going to be?

Reply With Quote
  #10  
Old November 7th, 2002, 08:51 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
Quote:
great, thanks btw, what kind of site is that site in your sig going to be?


I meant to answer that in my other reply when you first asked it.....
The signature is a corporate project that is currently being commissioned by our company. As the site address says, it is geared towards the xul community, gecko technology, xpcom, xpconnect, idl, etc., etc., etc.. The project itself is in early development stages and is slated to launch in January, 2003. Running a little bit behind right now as we are also working on a local government project that we just picked up with little turnaround time, but as soon as this is out of the way, we will be back in full on the xul developer project. I myself has not alot to do with the project in general, the shots are being called by my ADT and content providers, both individual and corporate. I am what you would call the paperwork guy.....

Last edited by jpenn : November 7th, 2002 at 08:54 PM.

Reply With Quote
  #11  
Old November 9th, 2002, 10:39 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Quote:
Originally posted by jpenn


I meant to answer that in my other reply when you first asked it.....
The signature is a corporate project that is currently being commissioned by our company. As the site address says, it is geared towards the xul community, gecko technology, xpcom, xpconnect, idl, etc., etc., etc.. The project itself is in early development stages and is slated to launch in January, 2003. Running a little bit behind right now as we are also working on a local government project that we just picked up with little turnaround time, but as soon as this is out of the way, we will be back in full on the xul developer project. I myself has not alot to do with the project in general, the shots are being called by my ADT and content providers, both individual and corporate. I am what you would call the paperwork guy.....


Ah, ok, nice.. btw, what happened to that breadcrumb function? also, I just noticed that you're mod over at the devshed forums.. I knew I had seen your name somewhere before!

Reply With Quote
  #12  
Old November 9th, 2002, 11:00 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
Quote:
Ah, ok, nice.. btw, what happened to that breadcrumb function?

Breaking it apart now - the breadcrumb function that is...
Quote:
also, I just noticed that you're mod over at the devshed forums.. I knew I had seen your name somewhere before!

Yes - a bunch of great developers over there, and they certainly keep me on my toes - I pop thru here on my break times....

But yes - I am breaking it apart as I am speaking. Will have it PM'd to you soon.....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > cool function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |