PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
dwfait
Forum Contributor
Posts: 113 Joined: Sun Aug 01, 2004 10:36 pm
Post
by dwfait » Thu Aug 12, 2004 3:20 am
would this work?
"news/$id.txt"
or would it come out as news/$id.txt?
If it does, how would i put the variable $id inside the string?
anjanesh
DevNet Resident
Posts: 1679 Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India
Post
by anjanesh » Thu Aug 12, 2004 3:29 am
Code: Select all
<?php
$id="hello";
$a="news/$id.txt";
$b='news/$id.txt';
echo $id.'<br>'.$a.'<br>'.$b.'<br>';
?>
Returns :
hello
news/hello.txt
news/$id.txt
dwfait
Forum Contributor
Posts: 113 Joined: Sun Aug 01, 2004 10:36 pm
Post
by dwfait » Thu Aug 12, 2004 3:49 am
thanks