Sorry if I'm missing something, there's a lot of replies after my first
post on this thread.
Is there something wrong with the floor() approach? I liked the regex
solution but isn't it more expensive and more verbose than just doing a
well commented is_numeric plus floor/ceil math?
Just trying
On 16-3-2013 19:20, Matijn Woudt wrote:
On Sat, Mar 16, 2013 at 6:52 PM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
Hi,
I have tried to find a way to check if a character string is possible to
test whether it is convertible to an intger !
any suggestion ?
BR georg
All
On Sun, Mar 17, 2013 at 10:20 PM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
On 16-3-2013 19:20, Matijn Woudt wrote:
On Sat, Mar 16, 2013 at 6:52 PM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
Hi,
I have tried to find a way to check if a character string is
On Fri, Mar 15, 2013 at 8:34 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Thu, Mar 14, 2013 at 7:02 PM,
georggeorg.chamb...@telia.com**
I have tried to find a way to check if a character string is
possible to
test whether it is convertible to an intger !
The op wasn't about
On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote:
Guess regex are the only useful solution here. When you consider to use
built-in functions, just remember, that for example '0xAF' is an integer
too, but '42.00' isn't.
Shoot...I hadn't considered how PHP might handle hex or octal
On Mar 16, 2013 6:14 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote:
Guess regex are the only useful solution here. When you consider to use
built-in functions, just remember, that for example '0xAF' is an
integer
too, but
On Sat, 2013-03-16 at 11:46 -0400, Andrew Ballard wrote:
On Mar 16, 2013 6:14 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote:
Guess regex are the only useful solution here. When you consider to use
built-in functions, just
Hi,
I have tried to find a way to check if a character string is possible to
test whether it is convertible to an intger !
any suggestion ?
BR georg
All responses in this thread have been very nice; but you could also try
a much simpler 2-step check:
1. is_numeric
2. if true check if
On Sat, Mar 16, 2013 at 6:52 PM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
Hi,
I have tried to find a way to check if a character string is possible to
test whether it is convertible to an intger !
any suggestion ?
BR georg
All responses in this thread have been very nice;
On Sat, Mar 16, 2013 at 12:21 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Sat, 2013-03-16 at 11:46 -0400, Andrew Ballard wrote:
On Mar 16, 2013 6:14 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote:
Guess regex
On 3/14/2013 4:05 PM, Matijn Woudt wrote:
On Thu, Mar 14, 2013 at 11:44 PM, Jim Lucas li...@cmsws.com wrote:
On 03/14/2013 11:50 AM, Samuel Lopes Grigolato wrote:
Something like if (is_numeric($var) $var == floor($var)) will do the
trick. I don't know if there's a better (more elegant)
On 15/03/13 06:21, Jim Lucas wrote:
On 3/14/2013 4:05 PM, Matijn Woudt wrote:
On Thu, Mar 14, 2013 at 11:44 PM, Jim Lucas li...@cmsws.com wrote:
On 03/14/2013 11:50 AM, Samuel Lopes Grigolato wrote:
Something like if (is_numeric($var) $var == floor($var)) will do
the
trick. I don't know if
On Fri, 2013-03-15 at 04:57 -0500, tamouse mailing lists wrote:
On Fri, Mar 15, 2013 at 3:55 AM, Peter Ford p...@justcroft.com wrote:
On 15/03/13 06:21, Jim Lucas wrote:
On 3/14/2013 4:05 PM, Matijn Woudt wrote:
On Thu, Mar 14, 2013 at 11:44 PM, Jim Lucas li...@cmsws.com wrote:
On
On 15/03/2013 22:00, Ashley Sheridan wrote:
On Fri, 2013-03-15 at 04:57 -0500, tamouse mailing lists wrote:
For my money, `is_numeric()` does just what I want.
The thing is, is_numeric() will not check if a string is a valid int,
but any valid number, including a float.
For something like
On 03/15/2013 02:33 PM, richard gray wrote:
On 15/03/2013 22:00, Ashley Sheridan wrote:
On Fri, 2013-03-15 at 04:57 -0500, tamouse mailing lists wrote:
For my money, `is_numeric()` does just what I want.
The thing is, is_numeric() will not check if a string is a valid int,
but any valid
On Fri, Mar 15, 2013 at 4:00 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
**
On Fri, 2013-03-15 at 04:57 -0500, tamouse mailing lists wrote:
On Fri, Mar 15, 2013 at 3:55 AM, Peter Ford p...@justcroft.com wrote:
On 15/03/13 06:21, Jim Lucas wrote:
On 3/14/2013 4:05 PM, Matijn
tamouse mailing lists tamouse.li...@gmail.com wrote:
On Fri, Mar 15, 2013 at 4:00 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
**
On Fri, 2013-03-15 at 04:57 -0500, tamouse mailing lists wrote:
On Fri, Mar 15, 2013 at 3:55 AM, Peter Ford p...@justcroft.com
wrote:
On 15/03/13
I suppose one could try something like this:
if (is_string($val) $val === (string)(int)$val)
If $val is an integer masquerading as a string, it should be identical to
the original string when cast back to a string, shouldn't it? (I can't try
it right now.)
Andrew
2013/3/16 Ashley Sheridan a...@ashleysheridan.co.uk
tamouse mailing lists tamouse.li...@gmail.com wrote:
On Fri, Mar 15, 2013 at 4:00 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
**
On Fri, 2013-03-15 at 04:57 -0500, tamouse mailing lists wrote:
On Fri, Mar 15, 2013 at 3:55
2013/3/16 Andrew Ballard aball...@gmail.com
I suppose one could try something like this:
if (is_string($val) $val === (string)(int)$val)
If $val is an integer masquerading as a string, it should be identical to
the original string when cast back to a string, shouldn't it? (I can't try
On Mar 15, 2013 9:54 PM, Sebastian Krebs krebs@gmail.com wrote:
2013/3/16 Andrew Ballard aball...@gmail.com
I suppose one could try something like this:
if (is_string($val) $val === (string)(int)$val)
If $val is an integer masquerading as a string, it should be identical to
the
Guess regex are the only useful solution here. When you consider to use
built-in functions, just remember, that for example '0xAF' is an integer
too, but '42.00' isn't.
Shoot...I hadn't considered how PHP might handle hex or octal strings when
casting to int. (Again, not in front of a computer
On Sat, Mar 16, 2013 at 2:54 AM, Sebastian Krebs krebs@gmail.comwrote:
2013/3/16 Andrew Ballard aball...@gmail.com
I suppose one could try something like this:
if (is_string($val) $val === (string)(int)$val)
If $val is an integer masquerading as a string, it should be
Hi,
I have tried to find a way to check if a character string is possible to test
whether it is convertible to an intger !
any suggestion ?
BR georg
On Thu, Mar 14, 2013 at 7:02 PM, georg georg.chamb...@telia.com wrote:
Hi,
I have tried to find a way to check if a character string is possible to
test whether it is convertible to an intger !
any suggestion ?
BR georg
You could use is_numeric for that, though it also accepts floats.
Something like if (is_numeric($var) $var == floor($var)) will do the
trick. I don't know if there's a better (more elegant) way.
On Thu, Mar 14, 2013 at 3:09 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 14, 2013 at 7:02 PM, georg georg.chamb...@telia.com wrote:
Hi,
I have
On 03/14/2013 11:50 AM, Samuel Lopes Grigolato wrote:
Something like if (is_numeric($var) $var == floor($var)) will do the
trick. I don't know if there's a better (more elegant) way.
On Thu, Mar 14, 2013 at 3:09 PM, Matijn Woudttijn...@gmail.com wrote:
On Thu, Mar 14, 2013 at 7:02 PM,
On Thu, Mar 14, 2013 at 11:44 PM, Jim Lucas li...@cmsws.com wrote:
On 03/14/2013 11:50 AM, Samuel Lopes Grigolato wrote:
Something like if (is_numeric($var) $var == floor($var)) will do the
trick. I don't know if there's a better (more elegant) way.
On Thu, Mar 14, 2013 at 3:09 PM,
On Sat, 5 Jan 2013 04:20:09 -0600, Kevin Kinsey wrote:
Nelson (et al),
I've enjoyed reading this thread and apologize for dredging it up.
It's interesting to see your progression of thought and the templating
discussion is indeed a worthy one.
However, I wanted to answer this objection
On Mon, Dec 31, 2012 at 02:29:38PM -0600, Nelson Green wrote:
On Mon, 31 Dec 2012 19:59:02, Ashley Sheridan wrote:
___
On Mon, 2012-12-31 at 13:39 -0600, Nelson Green wrote:
snip snip
Nelson (et al),
I've enjoyed reading this thread and apologize for
While using the *_once works in many cases, if you're doing a mass
mailing kind of thing, you want to use the standard include/require so
you can re-include it as your variables change:
foreach ($customers as $customer) {
$fullname = $customer['fullname'];
$address = $customer['address'];
Hello,
I have created a simple function that prints a personalized greeting by reading
the greeting contents from a file. I pass the user's name to the function,
and the function reads the file contents into a string variable. I am then
using str_replace to replace the word USER in the string
Yes!
Easy standard stuff.
$title = 'Mr.;
$user_name = 'John Doe';
$message = Hello $title $user_name
Just define the value for the variables before defining the value for
the message.
Note that $message has to use double quotes for the expansion. Also
consider using HEREDOC instead
On Mon, 2012-12-31 at 13:39 -0600, Nelson Green wrote:
Hello,
I have created a simple function that prints a personalized greeting by
reading
the greeting contents from a file. I pass the user's name to the function,
and the function reads the file contents into a string variable. I am
Please excuse the top post, but this may be helpful:
http://stut.net/2008/10/28/snippet-simple-templates-with-php/
-Stuart
--
Sent from my leaf blower
On 31 Dec 2012, at 19:59, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
On Mon, 2012-12-31 at 13:39 -0600, Nelson Green wrote:
Hello,
On Mon, 31 Dec 2012 19:59:02, Ashley Sheridan wrote:
___
On Mon, 2012-12-31 at 13:39 -0600, Nelson Green wrote:
My question is, is there another way to do something similar, such as
embedding a variable name directly into the text file? In other words,
On Mon, 31 Dec 2012 14:47:20 Stephen D wrote:
Yes!
Easy standard stuff.
$title = 'Mr.;
$user_name = 'John Doe';
$message = Hello $title $user_name
Just define the value for the variables before defining the value for
the message.
Note that $message has to use double quotes for
On Mon, Dec 31, 2012 at 2:37 PM, Nelson Green nelsongree...@hotmail.com wrote:
On Mon, 31 Dec 2012 14:47:20 Stephen D wrote:
Yes!
Easy standard stuff.
$title = 'Mr.;
$user_name = 'John Doe';
$message = Hello $title $user_name
Just define the value for the variables before
Bastien Koert
On 2012-12-31, at 4:58 PM, tamouse mailing lists tamouse.li...@gmail.com
wrote:
On Mon, Dec 31, 2012 at 2:37 PM, Nelson Green nelsongree...@hotmail.com
wrote:
On Mon, 31 Dec 2012 14:47:20 Stephen D wrote:
Yes!
Easy standard stuff.
$title = 'Mr.;
$user_name =
On 2012-12-31, at 4:58 PM, tamouse mailing lists tamouse.li...@gmail.com
wrote:
I use the include(template) method for this alla time, it works
great. Most especially for HTML emails coming from a web site to a
group of users, just slick as anything. include does basically just
what your
On 12-12-31 03:37 PM, Nelson Green wrote:
On Mon, 31 Dec 2012 14:47:20 Stephen D wrote:
Yes!
Easy standard stuff.
$title = 'Mr.;
$user_name = 'John Doe';
$message = Hello $title $user_name
Just define the value for the variables before defining the value for
the message.
Note that
On Mon, Dec 31, 2012 at 5:47 PM, Stephen stephe...@rogers.com wrote:
The common stuff for every page is defined in the file include.php. I
define the variable $markup in that file.
Here is the definition for $markup
$markup=HEREDOC
[[snippy]]
HEREDOC;
By using require_once instead of
I am trying to represent the variable:
$row['Bible_knowledge_phrase_solver_game_question_topics_1']
Where the # 1 is replaced by a variable --- $i
The following code executes without an error, but “Hello world” doesn’t show on
the screen.
?php
-Original Message-
From: Ron Piggott [mailto:ron.pigg...@actsministries.org]
Sent: Thursday, June 21, 2012 3:47 AM
To: php-general@lists.php.net
Subject: [PHP] Variable representation
I am trying to represent the variable:
$row['Bible_knowledge_phrase_solver_game_question_topics_1
or you can do this
echo $row[Bible_knowledge_phrase_solver_game_question_topics_$i];
I am trying to assign variables from an array into variables. This is
following a database query. Right now they are in an array:
$row[‘word_1’]
$row[‘word_2’]
$row[‘word_3’]
...
$row[‘word_25’]
I am trying to use this while look to assign them to variables:
$word_1
$word_2
$word_3
...
On 19 Apr 2012, at 15:46, Ron Piggott wrote:
I am trying to assign variables from an array into variables. This is
following a database query. Right now they are in an array:
$row[‘word_1’]
$row[‘word_2’]
$row[‘word_3’]
...
$row[‘word_25’]
Why those indices? Why isn't it just a
I am trying to use this while look to assign them to variables:
$word_1
$word_2
$word_3
...
$word_25
This should work for you:
http://us3.php.net/manual/en/function.extract.php
thnx,
Christoph
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On 04/19/2012 09:55 AM, Christoph Boget wrote:
I am trying to use this while look to assign them to variables:
$word_1
$word_2
$word_3
...
$word_25
This should work for you:
http://us3.php.net/manual/en/function.extract.php
thnx,
Christoph
Yes and you can use
On 02-04-2012 07:15, tamouse mailing lists wrote:
As for doing what you originally asked, that requires doing an eval()
on the statement utilizing string interpolation, like so:
eval('echo image $i is $image_' . $i . '.PHP_EOL;');
but I think that's a bit harder to read and understand
On Mon, Apr 2, 2012 at 4:34 AM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
Usually if you think you need to use eval: think again. In this case, it
again holds true.
Instead of doing what you do, you can also reference the variable as:
echo ${'image_'.$i};
or
echo
Hi Everyone:
I am assigning the value of 4 images to variables following a database query:
$image_1 = stripslashes( $row['image_1'] );
$image_2 = stripslashes( $row['image_2'] );
$image_3 = stripslashes( $row['image_3'] );
$image_4 = stripslashes( $row['image_4'] );
What I need help with is
It would better to just use an array, and then iterate through that.
$images[] = stripslashes( $row['image_1'] );
$images[] = stripslashes( $row['image_2'] );
$images[] = stripslashes( $row['image_3'] );
$images[] = stripslashes( $row['image_4'] );
foreach( $images as $k = $v ) {
$k++;
On 04/02/2012 06:52 AM, Ron Piggott wrote:
$image_1 = stripslashes( $row['image_1'] );
$image_2 = stripslashes( $row['image_2'] );
$image_3 = stripslashes( $row['image_3'] );
$image_4 = stripslashes( $row['image_4'] );
[...] (Not all 4 variables have an image.)
How is it meant in the database?
On 04/02/2012 07:46 AM, Adam Randall wrote:
$images[] = stripslashes( $row['image_1'] );
$images[] = stripslashes( $row['image_2'] );
$images[] = stripslashes( $row['image_3'] );
$images[] = stripslashes( $row['image_4'] );
$images[1] = stripslashes( $row['image_1'] );
$images[2] =
On Sun, Apr 1, 2012 at 10:52 PM, Ron Piggott
ron.pigg...@actsministries.org wrote:
Hi Everyone:
I am assigning the value of 4 images to variables following a database query:
$image_1 = stripslashes( $row['image_1'] );
$image_2 = stripslashes( $row['image_2'] );
$image_3 = stripslashes(
Ugh, gmail mangled the code there. Here's a pastebin of the response
which is better formatted: http://pastie.org/3712761
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, Apr 2, 2012 at 12:20 AM, tamouse mailing lists
tamouse.li...@gmail.com wrote:
Ugh, gmail mangled the code there. Here's a pastebin of the response
which is better formatted: http://pastie.org/3712761
Sweet. I spent so long on my reply, two others snuck in before me. :)
--
PHP General
I have a function defined thus:
function my_func ($arg1, $arg2, $arg3, $arg4, $arg5, $arg6)
{
// code here
}
I call this with variously the first three arguments only, or all six, taking
care that if I call it with fewer arguments then I don't try to acces $arg4,
$arg5, or
On 12 Feb 2012, at 18:51, Tim Streater wrote:
I have a function defined thus:
function my_func ($arg1, $arg2, $arg3, $arg4, $arg5, $arg6)
{
// code here
}
I call this with variously the first three arguments only, or all six, taking
care that if I call it with fewer
On 12 Feb 2012 at 19:01, Stuart Dallas stu...@3ft9.com wrote:
Optional arguments must be given a default value...
function my_func($arg1, $arg2, $arg3, $arg4 = null, $arg5 = null, $arg6 =
null)
Note that passing a default value by reference was not supported prior to
PHP5.
All the
On 01/09/2012 07:16 PM, Donovan Brooke wrote:
Just to share, a Mr. Harkness forwarded me a consolidated version of my
code.. basically substituting the innards for:
if (!isset($pmatch) || substr($key,0,strlen($pmatch)) == $pmatch) {
print $key = $valuebr /;
}
Cheers,
Donovan
I would
Jim Lucas wrote:
[snip]
if (!isset($pmatch) || substr($key,0,strlen($pmatch)) == $pmatch) {
print $key = $valuebr /;
}
[snip]
I would change the above the the following:
if ( empty($pmatch) || ( strpos($key, $pmatch) === 0 ) ) {
print $key = $valuebr /;
}
it would be slightly faster
some pretty natives php functions exists to do the job :
But how many times in my life will I have write echo pre; ???
Does anyone have a handy solution? (Make this the default behavior?
Add a even more human-readable flag to the function? Create a
simple macro in Aptana 3?)
Argz,
Marc
--
Marc Guay marc.g...@gmail.com wrote:
some pretty natives php functions exists to do the job :
But how many times in my life will I have write echo pre; ???
Does anyone have a handy solution? (Make this the default behavior?
Add a even more human-readable flag to the function? Create a
simple
Ashley Sheridan a...@ashleysheridan.co.uk wrote:
Marc Guay marc.g...@gmail.com wrote:
some pretty natives php functions exists to do the job :
But how many times in my life will I have write echo pre; ???
Does anyone have a handy solution? (Make this the default behavior?
Add a even more
On Mon, Jan 09, 2012 at 10:42:59AM -0500, Marc Guay wrote:
some pretty natives php functions exists to do the job :
But how many times in my life will I have write echo pre; ???
Does anyone have a handy solution? (Make this the default behavior?
Add a even more human-readable flag to the
Just to share, a Mr. Harkness forwarded me a consolidated version of my
code.. basically substituting the innards for:
if (!isset($pmatch) || substr($key,0,strlen($pmatch)) == $pmatch) {
print $key = $valuebr /;
}
Cheers,
Donovan
--
D Brooke
--
PHP General Mailing List
Hello!,
I work in another language mostly and often develop while displaying
variables (post,get,and defined) and their values at the bottom of the
page or in specific places. So, I thought I'd forward my PHP version as
an effort of good Karma to the list perhaps! ;-)
Below is 2 simple
Hi,
some pretty natives php functions exists to do the job :
var_export — Outputs or returns a parsable string representation of a variable
debug_zval_dump — Dumps a string representation of an internal zend value to
output
var_dump — Dumps information about a variable
print_r — Prints
Hi folks,
Let's say that I have 2 constants
DEFINE('DESKTOP_URL_en', http://www.website.com/index.php?page=home;);
DEFINE('DESKTOP_URL_fr', http://www.website.com/index.php?page=accueil;);
and I would like to populate the value of an href with them depending
on the
On 10/12/11 11:51, Marc Guay marc.g...@gmail.com wrote:
Let's say that I have 2 constants
DEFINE('DESKTOP_URL_en', http://www.website.com/index.php?page=home;);
DEFINE('DESKTOP_URL_fr',
http://www.website.com/index.php?page=accueil;);
and I would like to populate the value of an href with them
$var = constant('DESKTOP_URL_' . $_SESSION['lang']);
Very nice, thank you.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-Original Message-
From: Ron Piggott [mailto:ron@actsministries.org]
Sent: 01 October 2011 18:59
To: php-general@lists.php.net
Subject: [PHP] Variable question
If $correct_answer has a value of 3 what is the correct syntax
needed to use echo to display the value
If $correct_answer has a value of 3 what is the correct syntax needed to use
echo to display the value of $trivia_answer_3?
I know this is incorrect, but along the lines of what I am wanting to do:
echo $trivia_answer_$correct_answer;
$trivia_answer_1 = “1,000”;
$trivia_answer_2 = “1,250”;
On Oct 1, 2011, at 1:59 PM, Ron Piggott wrote:
If $correct_answer has a value of 3 what is the correct syntax needed to use
echo to display the value of $trivia_answer_3?
I know this is incorrect, but along the lines of what I am wanting to do:
echo $trivia_answer_$correct_answer;
On Sat, Oct 1, 2011 at 10:59 AM, Ron Piggott ron@actsministries.orgwrote:
If $correct_answer has a value of 3 what is the correct syntax needed to
use echo to display the value of $trivia_answer_3?
You can use variable variables [1] to access the variable by building its
name in a string:
On 11-10-01 02:03 PM, Mike Mackintosh wrote:
On Oct 1, 2011, at 1:59 PM, Ron Piggott wrote:
If $correct_answer has a value of 3 what is the correct syntax needed to use
echo to display the value of $trivia_answer_3?
I know this is incorrect, but along the lines of what I am wanting to do:
On 01 Oct 2011 at 18:59, Ron Piggott ron@actsministries.org wrote:
If $correct_answer has a value of 3 what is the correct syntax needed to use
echo to display the value of $trivia_answer_3?
I know this is incorrect, but along the lines of what I am wanting to do:
echo
On Sat, 1 Oct 2011, Mike Mackintosh wrote:
Best bet would to toss this into either an object or array for
simplification, otherwise that type of syntax would need the use of
eval.
example: eval('echo $trivia_answer_'.$correct_answer.';');
You could do:
$var =
Can anyone explain this to me.
function sendEmail($uname,$subjField,$firstname,$lastname,$email,
$reply,$e_cc,$e_bcc,$comments,$ip,$Date,$time){
$uname = trim($uname);
$subjField = trim($subjField);
$firstname = trim($firstname);
$lastname = trim($lastname);
$email =
On Jul 14, 2011, at 3:54 PM, Karl DeSaulniers wrote:
Can anyone explain this to me.
function sendEmail($uname,$subjField,$firstname,$lastname,$email,
$reply,$e_cc,$e_bcc,$comments,$ip,$Date,$time){
$uname = trim($uname);
$subjField = trim($subjField);
$firstname =
I am running into a variable collision. The project I'm developing is NOT
guaranteed to be operating on PHP5. Any solution I find should (hopefully) be
able to run on PHP4 (yes, I know PHP4 is deprecated).
I am building a bridge between two third-party applications. Both instantiate
their
Just to clarify, both packages are instantiating and calling their
respective database classes from the $db var, which is in the global scope.
Is this correct?
This is why I hate the global scope, I hate it, I hate it!
On Tue, Oct 5, 2010 at 3:47 PM, Brian Smither bhsmit...@gmail.com wrote:
I
Just to clarify, both packages are instantiating and calling their
respective classes from the $db var, which is in the global scope.
Is this correct?
I would say yes to the way you are asking. Take the following two applications.
The four respective statements are in each their respective
Short of refactoring ApplicationB, can you set it up as a SOAP/REST service
that AppA calls?
On Tue, Oct 5, 2010 at 5:02 PM, Brian Smither bhsmit...@gmail.com wrote:
Just to clarify, both packages are instantiating and calling their
respective classes from the $db var, which is in the global
If you have total control over application A which contains the bridge code,
the easiest is to change it to use a different global variable, $dbA. This
must not be doable or you wouldn't have asked.
If you have control over the bridge code, and it alone calls A and B, then
you could swap the $db
On 10-08-26 09:54 AM, João Cândido de Souza Neto wrote:
I know that in PHP I can use this:
$var1 = text;
$var2 = '$var1';
4cho $$var2;
So it gives me text.
It would if you didn't have typos and the wrong quotes in the above :)
My question is, is there a way of doing it with constant like
Really cool...
Thanks and fogive me by my mistake. hehe
--
João Cândido de Souza Neto
Robert Cummings rob...@interjinn.com escreveu na mensagem
news:4c76743a.2060...@interjinn.com...
On 10-08-26 09:54 AM, João Cândido de Souza Neto wrote:
I know that in PHP I can use this:
$var1 = text;
On 10 August 2010 18:08, Andrew Ballard aball...@gmail.com wrote:
On Tue, Aug 10, 2010 at 12:23 PM, Richard Quadling rquadl...@gmail.com
wrote:
On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
From: Richard Quadling
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
^^
Shouldn't that be $Set[1]?
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
Bob McConnell
--
PHP
On 11 August 2010 13:58, Bob McConnell r...@cbord.com wrote:
From: Richard Quadling
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
^^
Shouldn't that be $Set[1]?
$Value = 'Assigned';
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
The output is an empty array.
Examining $GLOBALS, I end up with an entries ...
[Set] = Array
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
The output is an empty array.
Examining $GLOBALS, I end up with an
On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?
The
On Tue, Aug 10, 2010 at 12:23 PM, Richard Quadling rquadl...@gmail.com wrote:
On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
?php
$Set = array();
$Entry
I need to store a variable name as a variable. Note quite a C-style
pointer, but a way to access one variable who's name is stored in
another variable.
As part of a spam-control measure, a certain public-facing form will
have dummy rotating text fields and a hidden field that will describe
which
On Mon, 2009-10-05 at 16:56 +0200, Dotan Cohen wrote:
I need to store a variable name as a variable. Note quite a C-style
pointer, but a way to access one variable who's name is stored in
another variable.
As part of a spam-control measure, a certain public-facing form will
have dummy
- Original Message
From: Dotan Cohen dotanco...@gmail.com
To: php-general. php-general@lists.php.net
Sent: Mon, October 5, 2009 7:56:48 AM
Subject: [PHP] Variable name as a variable?
I need to store a variable name as a variable. Note quite a C-style
pointer, but a way to access
On Mon, 5 Oct 2009 16:56:48 +0200
Dotan Cohen dotanco...@gmail.com wrote:
I need to store a variable name as a variable. Note quite a C-style
pointer, but a way to access one variable who's name is stored in
another variable.
As part of a spam-control measure, a certain public-facing form
1 - 100 of 817 matches
Mail list logo