Re: Newbie Variable Question

From: Date: Wed, 09 Mar 2005 16:15:53 +0000
Subject: Re: Newbie Variable Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-210316@lists.php.net to get a copy of this message
Jackson Linux wrote: ... > <php include_once "/path/to/cv.$r.include.php"; ?> asks for > cv.'1'.include.php ... And I need it to ask for cv.1.include.php > > How can I make a variable to fetch the literal number from the field > cv.category? Not 100% certain that it will work, but try casting the variable $r to an integer: <?php include_once "/path/to/cv." . (int) $r . ".include.php"; ?> > > Thanks in advance! > Jack -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.general (#210316) next »