-1

How to overwrite php default/builtin functions like gethostname(), die() etc..?

if we call a php function gethostname like echo gethostname(); it will return localhost or whatever the host of the machine is. Instead of that, I want to pass hostname as host1.

I want to pass a custom host name whenever gethostname is called.

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
sree
  • 389
  • 5
  • 17

1 Answers1

1

You could override the function and write the functionality on your own:

http://www.php.net/manual/en/function.override-function.php

Wamadahama
  • 1,489
  • 13
  • 19