May I humbly suggest, that you don't hold your breath. :o
coothead
Printable View
Coothead,
I'll try the resource you suggested.
A.
Hi there marain,
coothead
before you go, the reason that I told you that your requirement was
impossible was because I knew that it was impossible in javascript.
Here is javascript example...
Code:
<script>
(function( d ) {
'use strict';
var number = 600,
item = 'apples';
d.querySelector('div').textContent =
'We have ' + number + ' green ' + item + ' for you';
}( document ));
</script>
Are you sure? What about
[CODE]const AGE = 25;
console.log(`I'm ${AGE} years old!`);[\CODE] ?
See https://www.w3docs.com/snippets/java...avascript.html
A.
Hi there marain,
the example you gave is a different kettle of fish.
- it is using const rather than var
- it is using backticks rather than quotes
- the example that I gave used var and
quotes to match your PHP example
coothead
OK. Thanks for your patience.
A.
Solved! Here is the winning code:
The problem arose from the fact that when I used the script interpolation method, it became necessary to put braces around ALL of the interpolated variables.PHP Code:
echo "<br /><br />Your final quota of hands for this session was {$numbers[$_SESSION['limit']]}. This would have been hand number {$numbers[min(($_SESSION['bigCounter']+1),count($numbers)-1)]}. For that reason, we must deny at the moment your efforts for a new hand. We deny this new hand with respect and with love. BUT do not dispair: You can begin a <i>new</i> session when our webmistress returns from {$excuses[(rand(0, count($excuses)-1))]}. She should be coming back in a while. When she does, it will make her so happy if you are here. We hope you will not disappoint her. She will cheerfully review your starting quota of poker hands and, if necessary, adjust it.<br /><br />So hang out or, if necessary, come back later. Or feel free to refresh your <i>quotation</i>, above. You can do that while waiting!";
Coothead, I appreciate the attention to this problem that you provided.
BTW, the page on which this statement appears (in case anyone is interested) is https://www.marainlaw.com/page.php?here=quotations.
A.
Trust me: That will not happen very often ;-)