Page 1 of 1

how to obtain all variable in php file

Posted: Tue Jul 06, 2010 8:49 pm
by coolcc
hello everyone,ask a question.

have a php file.

Code: Select all

<?php
$a = 1;
$b = 'hello world';
$_SESSION['id'] = 31;
$_GET['string'] = 'intnumber';
have a test. one of question is :
have a function that similar "var_dump,print_r" can export variable , but the difference is export all of variable in the php file.

like use a function export

Code: Select all

[int]a=1
[string]b='hello world'
[int]$_SESSION['id']=31
[string]$_GET['string'] = 'intnumber';
this question is trouble.I try to read php file and use ereg search variable.but the answer isn't this. how to think everyone ?

Re: how to obtain all variable in php file

Posted: Tue Jul 06, 2010 9:09 pm
by califdon
So the purpose of the teacher asking the question is to see how much we know in the forum?

Re: how to obtain all variable in php file

Posted: Tue Jul 06, 2010 10:35 pm
by coolcc
I try to find a job . the examiner to ask me this question.I can't answer.so I come forums that hope anybody tell me the answer.

Re: how to obtain all variable in php file

Posted: Tue Jul 06, 2010 11:33 pm
by califdon
coolcc wrote:I try to find a job . the examiner to ask me this question.I can't answer.so I come forums that hope anybody tell me the answer.
I sincerely wish you good luck in getting a job, but I will not help you try to fool somebody that you know something that you do not know. That is dishonest. They asked you that question to find out how much YOU know, not how much somebody in the forum knows.

Re: how to obtain all variable in php file

Posted: Sat Jul 10, 2010 1:24 am
by coolcc
Thanks for your advice.I remember it.