$iCustomerId = IO::intValue("CustomerId");
why we use IO::intValue(); and other function similar to this.I am too confused about this.

Recommended Answers

All 6 Replies

It looks like there is IO.php (not necessarily) file with same class name (mandatory) in it to me.
I would say there is
public static function intValue($int = FALSE){}
or something like that inside class.

Are you familiar with OOP?

So, is there class I assumed?

From what script is this? Is it from PHP using a PHP/Java bridge, or simply a regular PHP script?

If it is from regular PHP application script, then the IO is the class or object and intValue is the static method of that object.

for example, we can have a class with static method like this

class IO{

    public function __construct(){
    }

    public static function intValue($id){

        return(intval($id));

        }
  }      

The class above can duplicate or allow us to test your code.

echo IO::intValue('50');

it should print out 50 which is an integer. Eventhough, I made it like a string.

My example above is extremely simple that in real world application, the class is not even needed due to int() function that can do the job with less code.

I think, all in case it is about pure PHP, class is more than that.
Someone made it, name it as IO so probably class has many methods for inputs and outputs like checking, returning etc.
Example @veedeoo gave is good one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.