php - Use variable as value in array key value pair -


i using braintree payment processing , sending data swift app , instead of hardcoding amount, want dynamic based on product select. possible set value of key value pair dynamic variable coming php script?

<?php  $price =  htmlentities($_request["price"]);  $tr_data = braintree_transparentredirect::transactiondata(                 array('redirecturl' => "http://" . $_server["server_name"] . ":" . $_server["server_port"] . parse_url($_server["request_uri"], php_url_path),                 'transaction' => array('amount' => $price, 'type' => 'sale'))) ?> 


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -