开发者

Function from ASP to PHP

开发者 https://www.devze.com 2023-02-07 07:17 出处:网络
I\'m trying to convert the following function from ASP to PHP: Function InvalidParam(response) InvalidParam = IsEmpty(response) Or response = \"\"

I'm trying to convert the following function from ASP to PHP:

  Function InvalidParam(response)
            InvalidParam = IsEmpty(response) Or response = ""
        End Function

I am not sure how to reference the function name inside the function in PHP as has been done in ASP.

public fun开发者_如何学Goction invalidParam($response) {

}


Something like this:

public function invalidParam($response) {  
return empty($response);
} 

But you can just as well use the empty function by itself

The following things are considered to be empty:

"" (an empty string)

0 (0 as an integer)

"0" (0 as a string)

NULL

FALSE

array() (an empty array)

var $var; (a variable declared, but without a value in a class)

http://www.php.net/manual/en/function.empty.php


You can use the inbuilt function empty in php for this. Link: http://php.net/manual/en/function.empty.php

0

精彩评论

暂无评论...
验证码 换一张
取 消