Voting

: max(two, five)?
(Example: nine)

The Note You're Voting On

jefrey.sobreira [at] gmail [dot] com
10 years ago
If you want to use a variable value in part of the name of a variable variable (not the whole name itself), you can do like the following:

<?php
$price_for_monday
= 10;
$price_for_tuesday = 20;
$price_for_wednesday = 30;

$today = 'tuesday';

$price_for_today = ${ 'price_for_' . $today};
echo
$price_for_today; // will return 20
?>

<< Back to user notes page

To Top