Skip to main content
Inspiring
August 24, 2006
Question

PHP Variables unloading

I have a lot of included files in my site. At the end of each included file,
I close the sql, but would also like to close the variables used to produce
the HTML.

I'm having a hard time with my searching getting some relevant results. Can
somebody help me here on what I"m looking for?

--

TIA,

Jon Parkhurst
PriivaWeb
http://priiva.net.


This topic is closed to new replies. Start a new post to keep the conversation going.

18 replies

Inspiring
October 5, 2006
;) thanks for the catch mate. and I just tested it within the code I was
using and it works great!

Jon


Translate
Inspiring
October 5, 2006
On Thu, 5 Oct 2006 12:01:18 -0500, "crash" <crash@bcdcdigital.com>
wrote:

>So, this:
>
>if(!empty($var)){
>
>is the same as this:
>
>if($var=""){
>
>correct?

No. You mean:

if($var != "") {

--
Steve
steve at flyingtigerwebdesign dot com
Translate
Inspiring
October 5, 2006
David-

So, this:

if(!empty($var)){

is the same as this:

if($var=""){

correct?

Thanks,

Jon


"David Powers" <david@example.com> wrote in message
news:eclcuo$hbd$2@forums.macromedia.com...
> Joe Makowiec wrote:
>>>That's what I was afraid of. It might be so, I just wish I could use
>>>the isset to check and see ifthey're still valid or not. I'm betting
>>>that if $myVar = '', it will still be T for isset.
>>
>> For some reason, and maybe it's the servers/version of PHP I'm on, I've
>> never gotten good results out of isset().
>
> No, you've got good results out of isset(). A variable that has been
> defined returns true with isset(). To test for a variable that has no
> value, use empty().
>
> As you have just discovered in your other post, unset() removes a variable
> entirely.
>
> --
> David Powers
> Adobe Community Expert
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> http://foundationphp.com/


Translate
Inspiring
August 26, 2006
Thanks David for the help!


Translate
Inspiring
August 26, 2006
yeah yeah yeah! Thanks Joe! I think that's exactly what I'm lookin gfor.

All these search engines work great - if you know wha tto search for. I
invariably choose the worst wording.

Thanks agina mate!

Jon
"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns9829B80111472makowiecatnycapdotrE@216.104.212.96...
> On Thu 24 Aug 2006 05:44:52p, crash wrote in
> macromedia.dreamweaver.appdev:
>
>>> the only way I know would be to do something like
>>>
>>> $myvar = '';
>>
>> That's what I was afraid of. It might be so, I just wish I could use
>> the isset to check and see ifthey're still valid or not. I'm betting
>> that if $myVar = '', it will still be T for isset.
>
> There is, however, this:
>
> http://www.php.net/manual/en/function.unset.php
>
> Haven't tried it myself. !@#$, that search function at php.net works
> wonders...


Translate
Inspiring
August 26, 2006
yeah yeah yeah! Thanks Joe! I think that's exactly what I'm lookin gfor.

All these search engines work great - if you know wha tto search for. I
invariably choose the worst wording.

Thanks agina mate!

Jon
"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns9829B80111472makowiecatnycapdotrE@216.104.212.96...
> On Thu 24 Aug 2006 05:44:52p, crash wrote in
> macromedia.dreamweaver.appdev:
>
>>> the only way I know would be to do something like
>>>
>>> $myvar = '';
>>
>> That's what I was afraid of. It might be so, I just wish I could use
>> the isset to check and see ifthey're still valid or not. I'm betting
>> that if $myVar = '', it will still be T for isset.
>
> There is, however, this:
>
> http://www.php.net/manual/en/function.unset.php
>
> Haven't tried it myself. !@#$, that search function at php.net works
> wonders...


Translate
Inspiring
August 26, 2006
yeah yeah yeah! Thanks Joe! I think that's exactly what I'm lookin gfor.

All these search engines work great - if you know wha tto search for. I
invariably choose the worst wording.

Thanks agina mate!

Jon
"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns9829B80111472makowiecatnycapdotrE@216.104.212.96...
> On Thu 24 Aug 2006 05:44:52p, crash wrote in
> macromedia.dreamweaver.appdev:
>
>>> the only way I know would be to do something like
>>>
>>> $myvar = '';
>>
>> That's what I was afraid of. It might be so, I just wish I could use
>> the isset to check and see ifthey're still valid or not. I'm betting
>> that if $myVar = '', it will still be T for isset.
>
> There is, however, this:
>
> http://www.php.net/manual/en/function.unset.php
>
> Haven't tried it myself. !@#$, that search function at php.net works
> wonders...


Translate
Inspiring
August 25, 2006
Thanks David for the help!


Translate
Inspiring
August 25, 2006
yeah yeah yeah! Thanks Joe! I think that's exactly what I'm lookin gfor.

All these search engines work great - if you know wha tto search for. I
invariably choose the worst wording.

Thanks agina mate!

Jon
"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns9829B80111472makowiecatnycapdotrE@216.104.212.96...
> On Thu 24 Aug 2006 05:44:52p, crash wrote in
> macromedia.dreamweaver.appdev:
>
>>> the only way I know would be to do something like
>>>
>>> $myvar = '';
>>
>> That's what I was afraid of. It might be so, I just wish I could use
>> the isset to check and see ifthey're still valid or not. I'm betting
>> that if $myVar = '', it will still be T for isset.
>
> There is, however, this:
>
> http://www.php.net/manual/en/function.unset.php
>
> Haven't tried it myself. !@#$, that search function at php.net works
> wonders...


Translate
Inspiring
August 25, 2006
Thanks David for the help!


Translate