how to use bitcoind jsonrpc for regtest or testnet server in php?
Very likely you need to tell your PHP JSON RPC client to connect to the right port.

If you start bitcoind without -regtest (= main net), it opens up the RPC server on port 8332.
If you use -regtest, the port will be 18332.

I can't see what kind of PHP JSON RPC client you are using, but there must be a way to tell it should use port 18332.