You are here: Appending an integer to a string « PHP Programming Language « IT news, forums, messages
Appending an integer to a string

Posted by Robizzle on 10/07/05 21:44

I am having problems appending a number to the end of a string. I
searched google and google forums and couldn't figure it out .... sorry
i'm sure its simple.

so I have:

$filename = 'test.file.";
$i = 0;

and I want to change $filename to become 'test.file.0'.

$filename .= $i; //doesn't work
$filename += $i; //doesn't work
$filename .= (string) $i; //doesn't work, nor does += (string) $i

So, how could I do this using these variables?

(I plan to do this inside a loop, and loop until test.file.i does not
exist, at which point I will create one and save the news post. I will
do the same to display the news on my front page -- loop through
starting at i=0 and display the contents of the files until test.file.i
does not exist)

Cheers,
-Rob

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация