473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Syntax to change value

I am trying to change a value but cant quite grasp the syntax
<?
$vtfa=test
$dn=1
?>

<td><?= $vtfa.$dn ?></td>

<? $dn = $dn + 1 ?>
<td><?= $vtfa.$dn ?></td>
<? $dn = $dn + 1 ?>
<td><?= $vtfa.$dn ?></td>

What I want are the three cells to consist of test1, test2 and test3. As you

Any help appreciated

Garry Jones
Sweden
Apr 19 '06 #1
1 1216
Garry Jones wrote:
I am trying to change a value but cant quite grasp the syntax
<?
$vtfa=test
$dn=1
?>

<td><?= $vtfa.$dn ?></td>

<? $dn = $dn + 1 ?>
<td><?= $vtfa.$dn ?></td>
<? $dn = $dn + 1 ?>
<td><?= $vtfa.$dn ?></td>

What I want are the three cells to consist of test1, test2 and test3. As you

Any help appreciated

Garry Jones
Sweden


Brute force:
<?php
$vtfa = 'test';
$dn = 1;
?>
<td><?php echo $vtfa.$dn;$dn++;?></td>
<td><?php echo $vtfa.$dn;$dn++;?></td>
<td><?php echo $vtfa.$dn;$dn++;?></td>

Slightly more elegant:
<?php
$vtfa = 'test';
for($dn=1; $dn < 4; $dn++) {
printf("<td>%s%d</td>\n", $vtfa, $dn);
}

-david-

Apr 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
14
by: bolidev | last post by:
I'm new to SQL and can't figure out how to update my table (StoreItemStatus) that contains the current status for items in each store (STORE_KEY, ITEM_KEY, STATUS,...). I get updated status info...
27
by: Adam Warner | last post by:
Hi all, In the code snippet below I successfully determine the address of val1:* struct o val1=l_SYM_2B(&a).o; print_aesthetic(&val1); The structure o is heavyweight. I understand...
3
by: Patrick Porter | last post by:
I am looking at followin the suggestion made by Larry on my last post. (his reply is on the bottom) it seems that you can't directly mess with the rich text header text....specifically the addtion...
21
by: Dmitry Anikin | last post by:
I mean, it's very convenient when default parameters can be in any position, like def a_func(x = 2, y = 1, z): ... (that defaults must go last is really a C++ quirk which is needed for overload...
8
by: aleksandar.ristovski | last post by:
Hello all, I have been thinking about a possible extension to C/C++ syntax. The current syntax allows declaring a function that returns a value: int foo(); however, if I were to return...
5
by: Diego Pino | last post by:
Hello, I am experience some problems reading a form variable from a Javascript function. The point with this particular variable is that its name has the following syntax: <input...
7
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record. SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
3
by: broll911 | last post by:
I am gettin a error message on this script can someone help me. I am a complete newbie on this stuff. Thanks in advance for any help you can give me. here is the error. Parse error: syntax error,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.