On 22 Mar 2002 at 17:27, Rick Emery wrote:
${varable}ABC
in quotes you can help php with
{$(varabl)}ABC
-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:21 PM
To: Rick Emery
Subject: Re: [PHP] Variable problem
on 3/22
Hi,
I'm asking me, what is the difference of the two ifs.
if($x)
echo $x;
if(!empty($x))
echo $x;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
if($x)
echo $x;
if $x is not defined you will get a warning but that depends on error settings in
php.ini.
This construction checks whether $x is defined or $x is true.
if(!empty($x))
echo $x;
$x must be defined.
--
PHP General Mailing List (http://www.php.net/)
To
Hi. I want to be able to access a key in a multidimensional array at some
depth n without knowing before runtime what the keys are.
I thought this might be possible using variable variables. Here's some
sample code using variable variables and multidimensional arrays:
$y = 'a';
$z = 'b';
$t =
I have a little chunk of code that checks to see if a variable exists and if
not then it sets it. It goes like this:
if (empty($page))
{
$page = login;
}
I then end that part of the php script after doing what I need to. Then I
start up again on the same html page and I assumed that $page
On Tue, 2002-03-12 at 14:38, David Johansen wrote:
I have a little chunk of code that checks to see if a variable exists and if
not then it sets it. It goes like this:
if (empty($page))
{
$page = login;
}
I then end that part of the php script after doing what I need to. Then I
Something most have just been wigging out or something because I can't get
it to do it again. Maybe I just did something wrong, but it seems to be
working now. Thanks for the help though,
Dave
Lars Torben Wilson [EMAIL PROTECTED] wrote in message
Hello,
I created a librairy with configuration setting: background color, font size,
customer's name, etc. Like this:
(lib_config.inc)
$bgcolor = #ff;
$co = ABC enterprise;
A second file is building html page headders:
(lib_intra.inc)
function title($name_section,$name_page){
print
Hi,
does anyone has an idea and example how to get the value of a js variable
into a
PHP variable, preferably working with sessionvariables or a hiddenform?
thank you!
Simon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You can add hidden field in form and before posting set it value to js
variable value that can be easily used by PHP script
Valentin Petruchek (aki Zliy Pes)
*** Cut the beginning ***
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To
:26 PM
Subject: RE: [PHP] Variable problem
Use an array !?, I mean :
$result[$i] = test;
How do I combine the following so it is treated as one variable
$i=10
$result$i=test;
I want this to be:
$result10=test;
$i changes so I cannot just put in 10 instead of I
Hello,
Thanks all. I will rename the second function.
Now if have:
if($wat==naam)$temp=make_naam($this);
else if($wat==anderenaam)$temp=make_anderenaam($this);
//etc..
But i would prefer something like
$temp=make_$wat($this);
How can i do this?
Tnx,
Bas
--
PHP General Mailing List
Hey Bas,
BVBut i would prefer something like
BV$temp=make_$wat($this);
I think you might want something along these lines:
eval(make_$wat($this););
HTH
-jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Hoi Bas,
$func = make_ . $wat;
$temp = $$func($this);
bvr.
On Thu, 31 Jan 2002 11:55:12 +0100, Bas Jobsen wrote:
Hello,
Thanks all. I will rename the second function.
Now if have:
if($wat==naam)$temp=make_naam($this);
else if($wat==anderenaam)$temp=make_anderenaam($this);
//etc..
But
On Thu, 2002-01-31 at 02:55, Bas Jobsen wrote:
Hello,
Thanks all. I will rename the second function.
Now if have:
if($wat==naam)$temp=make_naam($this);
else if($wat==anderenaam)$temp=make_anderenaam($this);
//etc..
But i would prefer something like
$temp=make_$wat($this);
How
Hello,
$func = make_ . $wat;
$temp = $$func($this);
I think one $.
$func = make_ . $wat;
$temp = $func($this);
will work
Bas
Op donderdag 31 januari 2002 12:17, schreef u:
Hoi Bas,
$func = make_ . $wat;
$temp = $$func($this);
bvr.
On Thu, 31 Jan 2002 11:55:12 +0100, Bas Jobsen
${$vNames[1]} = new value; // look at variable-variables in the manual
for more info
-Original Message-
From: Gaylen Fraley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 20, 2002 3:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable referencing/substitution
How can this be done
How can this be done?
If I have the name of a variable that is stored in an array, how do I use
the stored value to represent the actual variable?
Example:
$variable = old value;
$vNames[1] = '$variable'; //literal $variable
I want to say $vNames[1] = new value; /and have $variable actually
How do I combine the following so it is treated as one variable
$i=10
$result$i=test;
I want this to be:
$result10=test;
$i changes so I cannot just put in 10 instead of I.
anybody know how i can do that?
TIA
Randy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
?php
$i = 10;
eval (\$result$i=\test\;);
echo $result10;
?
Valentin Petruchek (aki Zliy Pes)
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 19, 2002 2:47 AM
Subject: [PHP] Variable Problem
Use an array !?, I mean :
$result[$i] = test;
How do I combine the following so it is treated as one variable
$i=10
$result$i=test;
I want this to be:
$result10=test;
$i changes so I cannot just put in 10 instead of I.
anybody know how i can do that?
--
Yoel Benitez
Hello.
How do I combine the following so it is treated as one variable
$i=10
$result$i="test";
I want this to be:
$result10="test";
$i changes so I cannot just put in 10 instead of I.
anybody know how i can do that?
TIA
Randy
How about the below.
?
$i=10;
${"result$i"}="test";
echo
How do I combine the following so it is treated as one variable.
It's a good question, but why? Most likely an array will work best for
this job, arrays are good:
http://www.php.net/manual/en/language.types.array.php
The man page on foreach is nice too, and has many examples which include
To: Fì¤á
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Variable Problem
How do I combine the following so it is treated as one variable.
It's a good question, but why? Most likely an array will
work best for
this job, arrays are good:
http://www.php.net/manual/en
-Original Message-
From: Philip Olson [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 19, 2002 2:30 PM
To: Fì¤á
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Variable Problem
How do I combine the following so it is treated as one variable.
It's a good
I can not wrap my head around variable variables today, not awake yet or
something.
For instance I trying something like this:
while ($i$loopcounter) {
$temp = size;
$valueofsize = $$temp$i;
$i++;
}
this doesn't work obviously, $valueofsize ends up with a literal value
PROTECTED]]
Sent: Thursday, January 17, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] variable variables
I can not wrap my head around variable variables today, not awake yet or
something.
For instance I trying something like this:
while ($i$loopcounter) {
$temp = size
On Thursday, January 17, 2002, at 10:11 AM, Mike Krisher wrote:
I can not wrap my head around variable variables today, not awake yet or
something.
For instance I trying something like this:
while ($i$loopcounter) {
$temp = size;
$valueofsize = $$temp$i;
try $valueofsize =
$valueofsize = ${size . $i};
or
$var = size . $i;
$valueofsize = $$var;
bvr.
On Thu, 17 Jan 2002 11:11:43 -0500, Mike Krisher wrote:
I can not wrap my head around variable variables today, not awake yet or
something.
For instance I trying something like this:
while ($i$loopcounter) {
On Thu, 17 Jan 2002 11:11:43 -0500, you wrote:
I can not wrap my head around variable variables today, not awake yet or
something.
For instance I trying something like this:
while ($i$loopcounter) {
$temp = size;
$valueofsize = $$temp$i;
$i++;
}
What about
$i = 0; // set
Hi!
I 'm trying not to hard code my php coding and I'm trying to pass a
variable name into the $row[coloumname_$variable];
I get an error message for this code.
I'm just wondering if I could do this trick using other ways of writing
it.
Thanks for reviewing!
regards,
Dani
--
PHP General
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
* On 16-01-02 at 12:45
* Dani said
Hi!
I 'm trying not to hard code my php coding and I'm trying to pass a
variable name into the $row[coloumname_$variable];
I get an error message for this code.
I'm just wondering if I could do
Hi!
I 'm trying not to hard code my php coding and I'm trying to pass a
variable name into the $row[coloumname_$variable];
$row[columname_$variable] should do it.
$row[constant] is threaten as constant which is normally not the programmers
intention (set_error_reporting(0) and you'll see
$row[coloumname_${v$ariable}]
-Original Message-
From: Dani [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 8:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] variable problem - help!
Importance: High
Hi!
I 'm trying not to hard code my php coding and I'm trying to pass
something like
?
$result = mssql_query($sql);
for ($i=0;$imssql_num_rows($result);$i++) {
mssql_data_seek($result,$i);
$row = mssql_fetch_object($result);
echo $row-someColumnInTable;
echo $row-someOtherColumnInTable;
}
?
-- Original Message
Hi, is it possible to print the sql query? i mean
i want to print the output of the command SELECT * FROM members;
and output it into html, i tried
print $result; -- it gives me different output..
Resource id #2
ty,
louie...
# PHP SCRIPT ###
html
use
$sql = select .. ;
$result = mysql_query($sql);
echo $sql;
--- louie miranda [EMAIL PROTECTED] wrote:
Hi, is it possible to print the sql query? i mean
i want to print the output of the command SELECT * FROM
members;
and output it into html, i tried
print $result; -- it gives me
A quick rewrite of your code:
?php
$conn = mysql_connect($host, $user, $pass);
if (!$conn) {
echo 'Could not connect: '. mysql_error();
exit;
}
mysql_select_db($dbname);
$sql= SELECT * FROM members;
$result = mysql_query($sql);
if (!$result) {
echo 'Could
Is there a way of swapping the values of two variables without involving a
third variable.
something similar to the SWAP(A$,B$) of BASIC
I have a big variable(array) and I want to keep my script's memory
requirements as low as possible.
-Bharath Bhushan Lohray
--
PHP General Mailing List
--
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
--
- Original Message -
From: Bharath Bhushan Lohray [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, December 09, 2001 1:24 PM
Subject: [PHP] Variable Swap
Hi,
Does anyone know of a way of passing other variables to the function being called by
preg_replace_callback? For instance, I have the following code:
function smarty_compile_lang($tpl_source) {
// en.php contains a very large array, $_lang
include_once '/home/test/en.php';
function _compile_lang($key){
global $_lang;
return $_lang[$key[1]];
} // End _compile_lang
HTH
Regards,
Andrey Hristov
- Original Message -
From: Peter Bowyer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 03, 2001 3:45 PM
Subject: [PHP] variable scope
This is perhaps elementary, but I cannot find solution in the documentation
I want to transfer to a php variable wheter I find a matching firstname in a group
from mysql db
function lookupFirstname ($fname, $gr, $conection)
{ $sql = SELECT firstname AS matches ;
$sql .= FROM persons
222@alfa...
This is perhaps elementary, but I cannot find solution in the
documentation
I want to transfer to a php variable wheter I find a matching firstname in
a group from mysql db
function lookupFirstname ($fname, $gr, $conection)
{ $sql = SELECT firstname AS matches ;
$sql .= FROM persons ;
$sql
Hello,
first of all I didn't exactely know where the right place is to ask this
question.
Well, my problem is that I just had some exams and am very unhappy on
how certain things were rated.
There's especially one question and I try to translate it as exact as
possible:
When is it possible
Hi Stephan,
IMHO, I think the answer requested is the only one that really makes
sense - as soon as I read it, _my_ first thought went to scope.
If a variable changes values, the other value is no longer usable, and
thus there aren't really two variables with the same name in that case.
When
original value)
are still accessible.
-Original Message-
From: Chris Hobbs [mailto:[EMAIL PROTECTED]]
Sent: 13 November 2001 17:09
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Variable definitions...
Hi Stephan,
IMHO, I think the answer requested is the only one
Hey everyone, I need some help with a variable issue. How can I delcare a variable and
then if a url variable of the same name is present use that value instead?
this is what I have:
if(!$dte)
{
$dte=date(j, time()+$ctime);
}
else
{
$dte=$dte;
}
and this causing an error in the 'if' expression.
The else clause can be removed, since it is not doing anything. What is the
error message?
Kirk
Hey everyone, I need some help with a variable issue. How can
I delcare a variable and then if a url variable of the same
name is present use that value instead?
this is what I have:
replace the if statement if(!$dte)
with
if (!isset($dte))
- Original Message -
From: Johnson, Kirk [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Friday, November 09, 2001 2:35 PM
Subject: RE: [PHP] variable issue
The else clause can be removed, since it is not doing
General
Subject: [PHP] variable issue
Hey everyone, I need some help with a variable issue. How can I delcare
a variable and then if a url variable of the same name is present use
that value instead?
this is what I have:
if(!$dte)
{
$dte=date(j, time()+$ctime);
}
else
{
$dte=$dte
To: PHP General
Subject: [PHP] variable issue
Hey everyone, I need some help with a variable issue. How can I delcare
a variable and then if a url variable of the same name is present use
that value instead?
this is what I have:
if(!$dte)
{
$dte=date(j, time()+$ctime);
}
else
{
$dte=$dte
Sorry all but I really need to figure this out. Here's a recap of my
problem:
I have an two dimensional array that is returned from code from an included
file. I'm assigning parts of the array to variables ( $variable =
$array[key][value]; ). This works fine and can be printed until I send
it
I have an two dimensional array that is returned from code from an included
file. I'm assigning parts of the array to variables ( $variable =
$array[key][value]; ). This works fine and can be printed until I send
it through a function eg. ( ereg_replace( , _, $variable); ). After
this,
Hello,
Is it possible to put variable operators in queries?
I tried this (the real variable comes from a form)
$Date_Operator =(=);
sql=SELECT * FROM poeple WHERE age $Date_operator 20;
$result_id = mysql_query($sql);
It doesn't work like this. I also tried:
sql=SELECT * FROM poeple WHERE
Hello all!
I installed PHP 4.0.6 om my server (Winnt server, Apache), and I started testing with
it.
The problem I have now is this:
I want to read the data passed from a form trough a variable.
Let's say the form field is called Test. I want to use $Test in my PHP script to read
that
? error_reporting(E_ALL);
$Test=3;
echo $Test;
?
And I get no warning about $Test not being declared before (like C
declaration).
Any1 has an example about forcing variable declaration?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
On Thu, 27 Sep 2001, it was written:
? error_reporting(E_ALL);
$Test=3;
echo $Test;
?
And I get no warning about $Test not being declared before (like C
declaration).
Any1 has an example about forcing variable declaration?
What do you mean force declaration? That's what you are
What do you mean force declaration? That's what you are doing with this
line:
$Test = 3;
Nop! This is just starting to use a variable. Something like:
integer $Test;
is declaring a variable. But FAFAIK it's not possible in PHP :(
--
* RzE:
--
-- Renze
What do you mean force declaration? That's what you are doing with this
line:
$Test = 3;
Nop! This is just starting to use a variable. Something like:
integer $Test;
is declaring a variable. But FAFAIK it's not possible in PHP :(
Like I said, that line does both. It sets the
That is the nature of a loosely typed scripting language. If you prefer a
strongly typed compiled language, there are plenty of those available.
-Rasmus
On Thu, 27 Sep 2001, * RzE: wrote:
Like I said, that line does both. It sets the type internally to an
integer and assigns the value.
That is the nature of a loosely typed scripting language.
I know.
If you prefer a strongly typed compiled language, there are plenty
of those available.
I know to. But those are not as powerful for building websites as
PHP. I mean... don't get me wrong here, I think PHP is great (or
even
Original message
From: sagar N Chand [EMAIL PROTECTED]
Date: Thu, Sep 27, 2001 at 06:01:26PM +0530
Message-ID: 005101c14750$c3189b10$0101a8c0@inferno
Subject: Re: [PHP] Variable declaration
its really a big headache with compilers like c bugging all the way just for
declarations.
its cl
I want PHP parser to warn/fail when I try to use a variable not declared
before. Like Option Explicit on ASP/VBA.
Thnx in advance :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the
I want PHP parser to warn/fail when I try to use a variable
not declared before. Like Option Explicit on ASP/VBA.
Look here:
http://www.php.net/manual/en/function.error-reporting.php
Chris
I can not figure out why this is not working!
for ($j=0; $j$resultNum; $j++) {
$newvar = finalresult.$a;
$$newvar[$a][name] = $resultRow[name];
$$newvar[$a][title]= $resultRow[title];
$$newvar[$a][descript] = $resultRow[descript];
$$newvar[$a][countkey] =
If I'm reading your snippet correctly, then :
$foo = 'bar';
$bar = array('apple','banana');
print ${$foo}[0]; // apple
Note the use of {braces}. The last paragraph in the manual describes this
a bit :
http://www.php.net/manual/en/language.variables.variable.php
Although I don't see
I want to use the value of a variable in a variable name. For instance:
$id = 1;
$sql_$id = hey; //set variable $sql_1 to hey
print $sql_1; //should print hey
I have looked high and low on how to do this. My first idea was eval but
I can't seem to get that to work in this instance. Any ideas?
I want to use the value of a variable in a variable name. For
instance:
$id = 1;
$sql_$id = hey; //set variable $sql_1 to hey
print $sql_1; //should print hey
I *believe* (could be wrong) what you want is this:
print ${$sql_1};
Check out variable variables in the dox.
Chris
$id = 1;
${sql_ . $id} = hey;
print $sql_1;
Try that
-Original Message-
From: Kyle Moore [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 9:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable naming
I want to use the value of a variable in a variable name. For instance
$id = 1;
$sql_1 = hey;
$vname = sql_.$id;
echo $$vname;
--
Fábio Migliorini
http://www.atua.com.br
[EMAIL PROTECTED]
UIN: 42729458
Linux User: 175409
- Original Message -
From: Kyle Moore [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 25, 2001 1:15 PM
Subject: [PHP
Read this
http://www.php.net/manual/en/language.variables.variable.php
Johan
www.pongworld.com
php tt
-Original Message-
From: Fábio Migliorini [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 12:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable naming
$id = 1
That was the ticket. Thanks a lot for your help
Adam Plocher wrote:
$id = 1;
${sql_ . $id} = hey;
print $sql_1;
--
Kyle Moore
UNIX Systems Administrator
Trust Company of America
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
On Friday 21 September 2001 01:45, Neil Silvester wrote:
Another PHP problem has kept me up all night, scouring through my database
books and trying everything I could think of. I am still new to the MySQL
and PHP field, but never the lass I will not give up.
$cat is a variable that is passed
Another PHP problem has kept me up all night, scouring through my database
books and trying everything I could think of. I am still new to the MySQL
and PHP field, but never the lass I will not give up.
$cat is a variable that is passed to the query from the previous page. The
SELECT statement
On Fri, 21 Sep 2001 11:15, Neil Silvester wrote:
Another PHP problem has kept me up all night, scouring through my
database books and trying everything I could think of. I am still new
to the MySQL and PHP field, but never the lass I will not give up.
$cat is a variable that is passed to the
I the Sears Christmas catologe is out, Im going to make a christmas wish
too.
I wish I could just do this
function test()
{
somefunc(func_get_args(), 'one more arg');
}
but I cant, I have todo this, ouch
function test()
{
$args = func_get_args();
eval(somefunc( '. implode(', ',
I have a form that reads in a couple variables via:
input type=textbox name=bob1
input type=textbox name=bob2
input type=textbox name=bob3
input type=textbox name=bob4
Now... I want to read in those variables in something like the following:
for($i=1;$i4;$i++) {
echo $bob$i;
}
BUT that
Original message
From: Ninety-Nine Ways To Die [EMAIL PROTECTED]
Date: Fri, Aug 31, 2001 at 10:28:56AM -0400
Message-ID: [EMAIL PROTECTED]
Subject: [PHP] Variable Syntax Question
I have a form that reads in a couple variables via:
input type=textbox name=bob1
input type=textbox name=bob2
Original message
From: * RzE: [EMAIL PROTECTED]
Date: Fri, Aug 31, 2001 at 04:36:36PM +0200
Message-ID: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable Syntax Question
Btw... Why not just use an array?
input type=text name=bob[]
input type=text name=bob[]
input type=text name=bob[]
input type
why can i read PATH_INFO server variable with apache under windows server ?
with IIS 5 it's OK
how can i ?
? print $PATH_INFO ? - Warning: Undefined variable: PATH_INFO in
e:\sitephp\php_edit\htdocs\var.php on line 3
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi All,
i have come across a strange problem with variable variables. Basicly i'm
doing the following and its not working:
$section = 'data[SITE][0][NAME][0]';
$pData = 'My Site.';
${sprintf('$%s', $section)}.=$pData;
but it is not working. But if
Hello,
I look through the php-general list database but could
not find the answer.
My question is I have some java script I want to store
the java script variable into a php variable so I can
submit it into a database. Here is the Java sript
code.
--
function show(){
if (!document.all
-Original Message-
From: Mike Mike [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 20, 2001 9:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Storing Java Script Varable into php variable
My question is I have some java script I want to store
the java script variable into a php variable
Hi Mike!
Generally the only way to send information from a clientside javascript to
a serverside language (in this case PHP) is via a form submit or putting
that value into an HREF the user will click. For example:
!-- your javascript functions
function show(){
if
Using mod_perl when an error is encountered, I have a customized error
screen that is defined in http.conf that is displayed to the user. This is
just a customized 500 page that then emails me which page crashed and all
of the local variables.
I can't seem to find a way to do this in PHP
Read http://php.net/set_error_handler
and http://php.net/trigger_error
Pay particular attention to the user notes on the set_error_handler()
page.
-Rasmus
On Thu, 19 Jul 2001, Randy Miller wrote:
Using mod_perl when an error is encountered, I have a customized error
screen that is defined
.
Consider the following class method reconstraction :
?php
$variable = array();
# I CAN NOT do variable variables thing here like
function ($$variable) {
if ($variable = Text) {
$result = input type=\text\ ;
foreach ($$variable as $prop=$value) {
$result .= $prop=\$value
$foo = foo definition;
- Original Message -
From: Jeremy Morano [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 18, 2001 1:55 PM
Subject: [PHP] variable
hi
is there any way I can pass a variable without using require() or
include()?
--
PHP General Mailing List (http
Hi Kent!
On Sat, 14 Jul 2001, Kent Sandvik wrote:
function sum_array( $input_array )
{
var $index;
var $sum = 0;
for( $index = 0; $index count( $input_array ); $index++ )
$sum += $input_array[ $index ];
return $sum;
}
The array variable issue has
function sum_array( $input_array )
{
var $index;
var $sum = 0;
for( $index = 0; $index count( $input_array ); $index++ )
$sum += $input_array[ $index ];
return $sum;
}
The array variable issue has indeed bitten me a couple of times, so now all
my arrays are
I have to agree that strong typing is not a good fit with PHP. It really
limits the flexibility of the language that is, at least to me, one it its
strongest appeals. Often, strong typing can be overly restrictive, and free
typing, when combined with good comments and documentation which
Hi Matthew,
Set your error_reporting level to E_ALL. The parser will then report the use
of undeclared variables.
--zak
- Original Message -
From: Matthew Aznoe [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 2:22 PM
Subject: [PHP] Variable name declarations
-Original Message-
From: Matthew Aznoe [mailto:[EMAIL PROTECTED]]
Subject: [PHP] Variable name declarations?
However, I do have one complaint about PHP that seems to have a tendency to
bite me far too often, and that is the lack of variable declaration. While
I do not think
Does anyone else have any thoughts on this?
error_reporting = E_ALL
in your php.ini file and PHP will warn you whenever you use an unitialized
variable.
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Sorry if this has been brought up 100 times.
I want to do this:
$y = 1;
while ($y = $Number_Children) {
if (!$C_Last_Name$y) {
error stuff;
$y++;
}
}
The form submitting information to this code has field name like
C_Last_Name1 C_Last_Name2
if (!$C_Last_Name$y) {
The form submitting information to this code has field name like
C_Last_Name1 C_Last_Name2 depending on how many Children
are signing up for something. So I need $y to represent the number.
You want this:
if (!{$C_Last_Name}{$y}) {
The {} surrounding the
--) {
if (! $Children_Last[$i]) {
// code
}
}
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Subject: [PHP] Variable Next To Variable?
Sorry if this has been brought up 100 times.
I want to do this:
$y = 1;
while ($y = $Number_Children
You could use an array:
like
input type=text name=C_Last_Name[1]
Way better this way
and you oculd do:
$y=1;
while($ycount($C_Last_Name)){
if(!$C_Last_Name[$y]){
error stuff;
y++;
}
}
Jeff Oien wrote:
I like this idea but it's giving me a parse error on this code:
if (!{$C_Last_Name}{$y})
I'm looking at the other ideas also.
Jeff Oien
if (!$C_Last_Name$y) {
The form submitting information to this code has field name like
C_Last_Name1 C_Last_Name2 depending on how many Children
601 - 700 of 817 matches
Mail list logo