Posted by ImOk on 05/05/06 19:21
I come from the Visual Foxpro world, which is one reason I love PHP.
VFP is a scripting type language with macro substitution abilities
similar to PHP.
Besides the regular expansion I can do crazy things (VFP uses & instead
of $):
x="sales"
sales="1000"
salestax="8.25"
? &x
..........prints 1000
? &x.tax
............prints 8.25
tr="trim"
? &tr.("xxx ")
..........prints xxx
? 'This function is &tr.("xxxxx ")'
....... prints This function is trim("xxxxx ")
In VFP the & indicates macro expansions and a space or a . idnicates
the variable termination. Can I do this kind of partial expansion in
PHP? There must be a trick somewhere.
Thanks.
[Back to original message]
|