我如何将php变量传递给<script data-x-y-z =“”> </ script>?

i have this php variable $post_price, and i want to pass it to that script,

 <script 

 data-transaction-total-amount=" what do i put here ?"></script>

You just need to use <?php echo $post_price; ?>

 <script 

     data-transaction-total-amount="<?php echo $post_price; ?>"></script>

Your question is far from clear, but I think you need:

<?php
$post_price = 111;
?>

<script data-transaction-total-amount="<?=$post_price;?>">
</script>