![]() |
PhP Question
How come when I try
$htmlfile=sprintf("./html/%s%d.html",$name,$num); it works fine but when I try to write $num as a string like so $htmlfile=sprintf("./html/%s%s.html",$name,$num); the resulting string gets partially overwritten. Is there a better way to do that? By the way I obtain $name and $num from 'list' of the out of 'explode' . |
If you want to make sure it's passed to sprintf as a string I think this should work:
$htmlfile=sprintf("./html/%s%s.html","$name","$num"); |
just tried it, still overwrites, thanks though
Quote:
|
You can just say:
Code:
$htmlfile = "./html/{$name}{$num}.html"; |
Swish, I think that { and } can be removed, right? :)
|
Quote:
PHP Code:
|
Quote:
Quote:
|
All times are GMT -7. The time now is 09:28 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123