I still have one more question. Now after the withdrawal is processed, how do i get the exact fees charged for that transaction. Because i want to display the amount charged for withdrawal to the user. So that he will have clarity. Where do i get this information?
Please tell me the php code to write this function?
Sadly, it's a very complex process to calculate the exact transaction fee as you have to build the entire transaction yourself. There's no RPC command that returns the exact fee for you. The easiest thing for you do to is probably estimate it... You can use the rpc command "estimatefee" and pass a variable "6" to it which will gives you the approximate fee per kilobyte needed for a transaction for x blocks (the '6' is for is 6 blocks). Your average transaction size is between 225-300 bytes for a bitcoin transaction with a low number of inputs. Over the years, most sites have set a high level watermark as a standard withdrawal fee for all withdrawals.
See this great answer from Chris M. (dooglas) on stackexchange:
https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending
Thankyou for your kind help. But i found a different working option. Another member from this forum helped me.