php-general Digest 14 Jul 2007 17:57:44 -0000 Issue 4903
Topics (messages 258843 through 258867):
Re: preg_replace() help
258843 by: Richard Lynch
Re: Alter an Array Key
258844 by: Richard Lynch
258855 by: Craige Leeder
258857 by: Stut
258863 by: Robert Cummings
258864 by: Robert Cummings
Re: PHP short tags: Questions
258845 by: Richard Lynch
Re: Strange output using include()/require()
258846 by: melz
Re: Social Networking Sites OT
258847 by: Richard Lynch
258848 by: Richard Lynch
258853 by: Craige Leeder
Re: The end of PHP4 is nigh!
258849 by: Richard Lynch
Re: Announcing Xaja, a PHP Reverse Ajax framework
258850 by: Richard Lynch
258851 by: Richard Lynch
258856 by: David Négrier
Re: SMS questions
258852 by: Richard Lynch
Re: Array Question
258854 by: Richard Lynch
258862 by: Robert Cummings
Time formatting issues
258858 by: Melissa
258859 by: Jay Blanchard
258861 by: Melissa
acerca de extensiones SQL Server
258860 by: Lic. Eduardo R. Hernández Osorio
258865 by: Robert Degen
258867 by: M. Sokolewicz
Re: Multiple Session Buffers
258866 by: Tony Marston
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Fri, July 13, 2007 3:52 pm, Rick Pasotto wrote:
> I have quotes like the following:
>
> $txt = 'A promise is a debt. -- Irish Proverb';
>
> I'd like to replace all the spaces afer the '--' with
>
> This is what I've tried:
>
> $pat = '/( --.*)(\s|\n)/U';
You might want to use \\s and \\n, so you are 100% clear that the PHP
strings have a single \ in them, and that they don't have a newline.
The .* is probably messing you up...
You could probably manage this with some kind of
preg_replace_callback, but it seems to me it would be easier to do:
$txt = 'A promise is a debt. -- Irish Proverb';
$pos = strpos($txt, '--');
$html = substr($txt, 0, $pos) . '--' . str_replace(' ', ' ',
substr($txt, $pos + 2));
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
On Fri, July 13, 2007 3:36 pm, OD wrote:
> Hello,
> Is there any easy way to alter a key's name?
>
> I would like to remove some underscores in the $_POST array keys.
Not directly, but:
$post = array();
foreach($_POST as $k => $v){
$k = str_replace('_', ' ', $k);
$post[$k] = $v;
}
You could dink with unset instead, but it's a Bad Idea to alter what
is actually in $_POST, imho.
And you also don't really want to add new elements to an array while
you iterate through it, generally... Though I think maybe foreach
does the right thing with that.
Better to build a new array and put the stuff you want into that.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
1. Don't modify $_POST
2. You controll the name of the array keys with the form. Why is there
any need to change them form PHP's side of things?
3. I'm not sure Roberts solution would work. I think it might result
in an endless loop, and timeout your script.
- Craige
--- End Message ---
--- Begin Message ---
Craige Leeder wrote:
1. Don't modify $_POST
Why not?
2. You controll the name of the array keys with the form. Why is there
any need to change them form PHP's side of things?
That's an assumption. A reasonable one in most cases, but not
necessarily the case.
3. I'm not sure Roberts solution would work. I think it might result
in an endless loop, and timeout your script.
I always worry about adding or removing elements while iterating through
an array. I generally build up an array of keys to remove and remove
them in a separate loop afterwards just to be on the safe side.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Sat, 2007-07-14 at 01:57 -0400, Craige Leeder wrote:
>
> 3. I'm not sure Roberts solution would work. I think it might result
> in an endless loop, and timeout your script.
It works fine.
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
--- End Message ---
--- Begin Message ---
On Sat, 2007-07-14 at 14:09 +0100, Stut wrote:
>
> > 3. I'm not sure Roberts solution would work. I think it might result
> > in an endless loop, and timeout your script.
>
> I always worry about adding or removing elements while iterating through
> an array. I generally build up an array of keys to remove and remove
> them in a separate loop afterwards just to be on the safe side.
I'm, not entirely sure, but I think foreach may grab a copy of the keys
before iteration. I've never worried about that in foreach although I
can remember issues back in the old days with the reset(), next(), end()
set of array traversal functions :)
If you're at all worried anyways, you can always do:
<?php
foreach( array_keys( $_POST ) as $key )
{
if( strpos( $key, '_' ) !== false )
{
$_POST[str_replace( '_', '', $key )] = $_POST[$key];
}
}
?>
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
--- End Message ---
--- Begin Message ---
On Fri, July 13, 2007 8:54 am, Daniel Brown wrote:
> To my knowledge (and even a quick peek at
> http://www.php.net/ini.core), there is no indication that
> short_open_tags is deprecated, nor that it's "been on the verge of
> removal" at any point. I don't want to start a flame war, but it
> sounds like you've been given some bad information. In fact, removing
> the short_open_tags core directive would not only cause probably more
> than half of existing scripts to break (that's just an educated guess,
> of course), but would also completely eradicate the PHP core feature
> of shorthand output:
You must have missed this:
http://php.net/~derick/meeting-notes.html#remove-support-for-and-script-language-php-and-add-php-var
This is at least one major PHP Dev Team meeting where remove short
open tags was on the table...
I do not know of the current status of this topic.
This meeting was almost 2 years ago.
The conclusion in the above URL should not be considered current, much
less final.
> <?php
> echo "This is output.\n";
> ?>
>
> .... versus:
>
> <?="This is output.\n"?>
>
> Also note that, with shorthand output, the echoed output does not
> need a semicolon at the end if it's a single line. I generally do it
> out of habit, but for the purpose of illustration here, I omitted the
> semicolon. Additionally, a disclaimer should be made in favor of the
> anti-short_open_tags people, where the three lines can safely coexist
> on one.
The omission of the semi-colon is not related in any way, shape, or
form to the short open tag.
It works completely independently of that.
It also is completely irrelevant how many lines you use to type the
code, nor how many lines of PHP there are. This is perfectly valid
code:
<?php
echo 'foo'
?>
I do not foresee this feature disappearing, personally, but I'm not
involved in making that decision.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
DJ Necrogami wrote:
That's UTF-8 Open it in a Unicode File Editor Change it from ANSI to UTF-8
and back to ANSI and then resave and it will go away
Incidently, is there no way that I could keep all my files as UTF-8 and
not have that encoding problem? I just realized one of my config files
store some international characters and I need to keep them that way.
I tried saving all 3 files into UTF-8 but the issue persists, so I'm
assuming it doesn't work with UTF-8 files?
Thanks for your help.
-m.
--- End Message ---
--- Begin Message ---
On Fri, July 13, 2007 7:53 am, Robert Cummings wrote:
> On Thu, 2007-07-12 at 23:51 -0500, Richard Lynch wrote:
>> It's gotten to the point where I pretty much view social networking
>> sites as just another form of spammers...
>>
>> I blogged about it, and would like feedback from members of this
>> lists, for various reasons I would hope would be obvious.
>>
>> PLEASE put responses in my blog, or your blog, or whatever, but not
>> here, as I'm sure this thread could be quite annoying as it has
>> minimal to zero concrete PHP content.
>>
>> http://richardlynch.blogspot.com/
>
> I didn't feel like logging in so I'll post my comment here:
>
> The whole idea behind a social network is that you can socially
> network... as such inviting your friends is a great approach. I use
> facebook and from time to time I do indeed invite my friends. The
> problem you are experiencing is abuse of the feature. You have
> entities
> outside of what you would call friends that are hitting you up for a
> connection. The solution to this really should be the opportunity to
> register your address with the social network such that you will no
> longer receive requests.
Which you will note was in my proposal...
But I think it should be a "standard" to have such a link in every
invite email, so one doesn't have to go digging through a site to try
to find a way to contact somebody who runs the site to ask for a total
ban on their email.
I blew at least 10 to 15 minutes the other day trying to find a way to
get through to Facebook, for example. They have that annoying
practice of not actually providing a contact email until you've gone
through the web equivalent of voice-mail hell clicking through page
after page of FAQs that have nothing to do with your problem. :-(
If somebody is really your friend, just send them an email direct or
give them a call -- Don't expose their email to the social networking
site owners.
I also don't really want to have to run through that process for every
new social networking site. I've done it a lot, and it's getting
quite tiresome now...
Perhaps I'm just a minority, but the social-networking sites are being
abused a whole lot for this particular email...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
On Fri, July 13, 2007 5:20 pm, Tijnema wrote:
> I get invites from a lot of friends, but the problem is they all come
> from different sites (hyves, facebook, some dutch sites,...)
If somebody wants the next Web 2.0 killer app, build a
meta-social-networking site that lets the user manage all the big
social networking sites through a single central interface. :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
On 7/14/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
If somebody wants the next Web 2.0 killer app, build a
meta-social-networking site that lets the user manage all the big
social networking sites through a single central interface. :-)
Is it sad that I thought of that while reading this topic?
Anyway, I always told myself I'd never sign up for any of those sites,
and for the longest time, I didn't. However, a few weeks ago I
registered for my Facebook account, and it's not as bad as I thought.
I have had random people I've only met once try to add me as a friend,
but I simply ignore them.
So my thoughts? I say that they're fine in moderation. Don't let it
become an addiction, and it's fine.
--- End Message ---
--- Begin Message ---
On Fri, July 13, 2007 9:48 am, Daniel Brown wrote:
> Fork!
Good luck!
And, really, nothing is to stop you from running PHP4 for as long as
you want...
I mean, if they haven't found a critical security issue by 8/8/2008,
they probably never will find it...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
ZA-jah probably...
SHA-jah maybe
English is such potpourri of other languages that there are no real
pronunciation rules.
On Fri, July 13, 2007 5:44 am, David Négrier wrote:
> Hi Mario, hi Stuart,
>
> I fixed the SVN repository. You can try it now, it works better.
> Regarding the way Xaja is pronounced.... well.... mmmm.... that's a
> good
> question.
> Actually, I'm French and my pronunciation is... well... French ;), so
> I
> won't give you any advice on how to pronounce it.
> However, I will present Xaja in San Francisco at the Ajax Experience
> (a
> conference about Web 2.0 development). I will ask some people there if
> they can give me a clue on the way to pronounce it in English ;).
>
> Best regards,
> David.
>
>
> Mario Guenterberg a écrit :
>> On Fri, Jul 13, 2007 at 10:10:15AM +0200, David Négrier wrote:
>>
>>> Xaja is still in an early stage of development, but it is time for
>>> us to get
>>> some feedback (or some help, since it is released in GPL). You can
>>> download
>>> an alpha version of Xaja from
>>> http://www.thecodingmachine.com/projects/xaja
>>> You can view a screencast presenting Xaja at :
>>>
>>> http://www.thecodingmachine.com/cmsDoc/xaja/trunk/screencast.html?group_id=29
>>>
>>> Thanks in advance to anyone sending me comments or problems
>>> regarding Xaja.
>>>
>>>
>>
>> Hi...
>>
>> I will test your framework but the checkout for the svn repo don't
>> accept the username and password documented in the website. :-(
>>
>> Greetings
>> Mario
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
You can't even be guaranteed to GET the client's IP address in their
request, much less assume that it's going to be the same when you want
to push data out to it!!!
So any Xaja-like technology has to rely on keeping the HTTP connection
open, really...
Does seem pretty cool, though probably not scalable for heavily loaded
servers.
On Fri, July 13, 2007 1:59 pm, Nathan Nobbe wrote:
>> On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> I haven't looked at the code for Xaja and in no way do I want to
>> subtract from its potential, but I'm going to guess that in some way
>> it
>> holds the HTTP connection open and as such is an expensive feature.
>> Also, I'm not entirely sure, but isn't that the principle that Comet
>> uses?
>
> As i said ive only imagined such a feature. In my imagination i
> wonder if
> it is possible to
> track the clients address in a data structure within the application.
> Then
> a connection could be
> established whenever a push was needed. I also think the app would
> have to
> track the last page
> a user requested in order to realize such an implementation. This
> *should*
> be feasible using
> sessions because whenever the client makes a new request the last page
> variable could be updated.
> I havent seen nor heard of Comet; would you mind providing a link?
>
> -nathan
>
> On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>>
>> On Fri, 2007-07-13 at 14:28 -0400, Nathan Nobbe wrote:
>> > I have imagined being able to connect to a client browser and push
>> changes
>> > to the client rather than have something sit on the client side
>> and
>> > periodically wait for updates.
>> > or only update when the client refreshes the page manually. both
>> of
>> those
>> > antiquated options are ugly. the push technique discussed in this
>> email
>> is
>> > essentially leveraging
>> > the Observer design pattern. As i said i imagined it could be
>> achieved
>> via
>> > ajax, but wasnt sure on the implementation.
>> > im curious now to see it in action and pour through the Xaja code
>> for
>> the
>> > answer to the riddle!
>> > btw.
>> > i found myelf thinking of the pronouciation as ZahJah.
>>
>> I haven't looked at the code for Xaja and in no way do I want to
>> subtract from its potential, but I'm going to guess that in some way
>> it
>> holds the HTTP connection open and as such is an expensive feature.
>> Also, I'm not entirely sure, but isn't that the principle that Comet
>> uses?
>>
>> Cheers,
>> Rob.
>> --
>> ...........................................................
>> SwarmBuy.com - http://www.swarmbuy.com
>>
>> Leveraging the buying power of the masses!
>> ...........................................................
>>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
Indeed, Xaja relies on the keeping of an open connexion between the server
and the browser.
In fact, it uses, the Comet approach (which is a pain to implement in
Javascript because the IE code and the Firefox code are completely
different).
(more information here:
http://www.thecodingmachine.com/cmsDoc/xaja/trunk/architecture.html)
The whole idea behind Xaja is to built a complete framework on top of the
Comet-like javascript library that will enable the developer to write as
few Javascript as possible. So, indeed, through the "XajaController"
object, we are implementing a "data driven programming" library on top of
the classical request/response HTTP protocol.
Regarding performances: Indeed, since a connexion is kept open for each
browser, this consumes a few connexions on the server (that's not a big
problem). Each process also takes some memory. Xaja is still in an early
stage of development and I haven't had the opportunity to run a full
performance test, but basically, right now, I can tell that a simple
applications takes 5 Mo of RAM per client. Which means that for 100
concurrent users, you need 500 Mo of RAM on your server. Now, the vast
majority of the servers have less than 100 concurrent users, and at this
early point in the development cycle of Xaja, I wouldn't recommend
installing Xaja on a server that has more than 100 concurrent users! ;)
Regards,
David.
Nathan Nobbe a écrit :
> I understand the use of AJAX to only update a subset of the DOM on a page,
> rather than rebuild the entire page. What i was getting at though is
> eliminating
> the busy-wait model by using the Observer pattern to push changes to the
> client
> only when the data has changed on the server side. This is decidedly more
> efficient in general and is more commonly referred to as *event driven
> programming*
> or *data driven programming*. it sounds like the only way to implement
such
> a model
> over HTTP is by keeping the connection open; which in some circumstances
may
> be appropriate.
> I have to say though, I never thought of using busy waiting to update
just a
> portion
> of the DOM. It seems like almost a no-brainier, but since i havent worked
> w/ AJAX
> much it just never crossed my mind. That sounds like the most practical
> approach in
> general.
>
> -nathan
>
>
> On 7/13/07, Tijnema <[EMAIL PROTECTED]> wrote:
>>
>> On 7/13/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
>> > > On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> > > This isn't possible since you can't request a connection to the
>> client's
>> > > machine. Only the other way around.
>> >
>> > hmm... in that case perhaps the open connection could be employed and
>> > the feature used selectively; only on certain pages for instance ?
>> > im thinking mainly of a monitoring page; like an app that shows a
>> servers
>> > state,
>> > or stock quotes or something.
>> > the main reason i dont like a javascript timer refreshing the page is
>> > sometimes you
>> > dont want the whole page refreshed; especially when halfway through
>> filling
>> > out a
>> > form on the page ;)
>> >
>> > -nathan
>>
>> Well, that's why AJAX is there, you do a check to a server to see if
>> there's any new data to parse, if so, then you update (and probably
>> only one or two divs on your site, and not the whole page)
>>
>> Keeping connection open isn't quite bad for sites that are visited a
>> lot, as for each connection, a new port is opened to handle a client
>> connection. While you think you're connected to port 80, it is
>> actually redirected to another port (mostly from 3000 onwards). So, if
>> you have a lot of visiters, you might reach the limit of ports, 65536
>> (0-65535). Some of them are already in use, so you end up to have a
>> limit of about 65530 connections to keep open. For a normal site this
>> isn't a problem, but if you count on shared hosts, with let's say 20
>> sites, then they can all handle about 3200 connections. Half of the
>> users has probably more then one window open, which means another
>> connection. So you end up to have a maximum of about 2000 visiters at
>> same time for each site.
>>
>>
>> Tijnema
>>
>> >
>> > On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> > >
>> > > On Fri, 2007-07-13 at 14:59 -0400, Nathan Nobbe wrote:
>> > > > > On 7/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> > > > > I haven't looked at the code for Xaja and in no way do I want to
>> > > > > subtract from its potential, but I'm going to guess that in some
>> way
>> > > > it
>> > > > > holds the HTTP connection open and as such is an expensive
>> feature.
>> > > > > Also, I'm not entirely sure, but isn't that the principle that
>> > > > Comet
>> > > > > uses?
>> > > >
>> > > > As i said ive only imagined such a feature. In my imagination i
>> > > > wonder if it is possible to
>> > > > track the clients address in a data structure within the
>> application.
>> > > > Then a connection could be
>> > > > established whenever a push was needed.
>> > >
>> > > This isn't possible since you can't request a connection to the
>> client's
>> > > machine. Only the other way around.
>> > >
>> > > > I also think the app would have to track the last page
>> > > > a user requested in order to realize such an implementation. This
>> > > > *should* be feasible using
>> > > > sessions because whenever the client makes a new request the last
>> page
>> > > > variable could be updated.
>> > > > I havent seen nor heard of Comet; would you mind providing a link?
>> > >
>> > > http://ajaxian.com/archives/comet-a-new-approach-to-ajax-applications
>> > >
>> > > Cheers,
>> > > Rob.
>> > > --
>> > > ...........................................................
>> > > SwarmBuy.com - http://www.swarmbuy.com
>> > >
>> > > Leveraging the buying power of the masses!
>> > > ...........................................................
>> > >
>> >
>>
>>
>> --
>> Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
>>
>
--- End Message ---
--- Begin Message ---
On Fri, July 13, 2007 9:38 am, Robert Cummings wrote:
> On Fri, 2007-07-13 at 22:30 +0800, Crayon Shin Chan wrote:
>> On Friday 13 July 2007 14:07, Richard Lynch wrote:
>>
>> > I'd give a lot of money to be able to teleport back in time and
>> yell
>> > at the email designer folks to tell them just how horrible a mess
>> they
>> > were making... :-)
>>
>> But you have to give them credit for designing something so
>> scaleable that
>> even decades later it is still able to cope with the billions of
>> spam. On
>> the other hand if it weren't so scaleable it might have forced some
>> drastic changes much earlier to curtail spam. Something like this:
>>
>> http://cr.yp.to/im2000.html
>>
>> in which the sender is responsible for storing the mail until the
>> intended
>> recipient retrieves it seems like a good start.
>
> Bleh, that's so easily solvable for spammers. Create one real message,
> then softllink it for every actual email they send out. Millions of
> links are cheap.
>
> Of course, that sort of presumes they use their own computers :)
It won't reduce the number of "spams" being sent, but at least they'll
be a lot smaller, with only a couple headers...
Plus, any rampant spammer can be tracked down to their hard drive, and
action can be taken, or their URLs can just be blocked by proxies to
end traffic to them.
It won't eliminate, or even reduce spam, most likely, but it oughta
reduce the harm done by spam.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
On Fri, July 13, 2007 2:15 am, Richard Lynch wrote:
> On Thu, July 12, 2007 8:29 am, Robert Cummings wrote:
>> Hmmm, I thought using an explicit cast was very self explanatory --
>> especially when the name of the cast is "array". Maybe I'm alone in
>> that
>> thought. I mean if you convert a scalar to an array what do you
>> expect
>> to get? An array with the scalar. *shrug* I can't see how it would
>> be
>> anything else.
>
> $foo = (array) 'foo';
> var_dump($foo);
>
> A couple perfectly reasonable (though wrong) outputs:
>
> #1
> array (3){
> 0 => 'f',
> 1 => 'o',
> 2 => 'o'
> );
>
> And, actually, PHP having been derived (partially) from C, one could
> almost argue this is the EXPECTED output. :-)
In retrospect, given that $foo[1] is 'o' and that you can treat $foo
JUST like an array of characters, the EXPECTED output from a C->PHP
perspective might be:
string (3) 'foo'
It already *IS* an array, to a large extent.
:-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
On Sat, 2007-07-14 at 00:55 -0500, Richard Lynch wrote:
> On Fri, July 13, 2007 2:15 am, Richard Lynch wrote:
> > On Thu, July 12, 2007 8:29 am, Robert Cummings wrote:
> >> Hmmm, I thought using an explicit cast was very self explanatory --
> >> especially when the name of the cast is "array". Maybe I'm alone in
> >> that
> >> thought. I mean if you convert a scalar to an array what do you
> >> expect
> >> to get? An array with the scalar. *shrug* I can't see how it would
> >> be
> >> anything else.
> >
> > $foo = (array) 'foo';
> > var_dump($foo);
> >
> > A couple perfectly reasonable (though wrong) outputs:
> >
> > #1
> > array (3){
> > 0 => 'f',
> > 1 => 'o',
> > 2 => 'o'
> > );
> >
> > And, actually, PHP having been derived (partially) from C, one could
> > almost argue this is the EXPECTED output. :-)
>
> In retrospect, given that $foo[1] is 'o' and that you can treat $foo
> JUST like an array of characters, the EXPECTED output from a C->PHP
> perspective might be:
>
> string (3) 'foo'
>
> It already *IS* an array, to a large extent.
>
> :-)
When in Rome do as the Romans. PHP has a very distinct definition for an
array and for a string. If you think you're using C then maybe you
should go read the documentation. Assumptions based on previous
experience only go as far as they are right. Since you explicitly cast
to an array and not to a string, it can only be expected that you have
an array -- or an exception as you previously offered. But we know you
get an array because it's documented.
:)
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
--- End Message ---
--- Begin Message ---
I have a DB
with a field type DATE (called TideDATE)
and a field type TIME (one of which is called highFIRST)
How can I format the time fields from displaying 00:00:00 (a 24 hour clock)
to HH:MM am/pm format?
The DATE function has all kinds of neat formatters, but I do not find any
for TIME
In DATE, I would say "g:i A"
If I try it with a TIME field, I get errors!
I HAVE NEVER USED A NEWSGROUP BEFORE, SO I HOPE I HAVE DONE THIS
CORRECTLY...
--- End Message ---
--- Begin Message ---
[snip]
I have a DB
with a field type DATE (called TideDATE)
and a field type TIME (one of which is called highFIRST)
How can I format the time fields from displaying 00:00:00 (a 24 hour
clock)
to HH:MM am/pm format?
[/snip]
Have a look at http://www.php.net/mktime
--- End Message ---
--- Begin Message ---
Thank you, Jay, that is interesting.
I am looking for the am / pm denomination, which I do not see in mktime()
I am essentially trying to have the TIME type which is a 24 hour clock
display instead as a 12 hour clock with am and pm.
I AM A TOTAL NEWBIE, (2ND DAY ever) so if I misunderstood the answer, I am
sorry!
Melissa
--- End Message ---
--- Begin Message ---
Hi:
I need use the SQL extension on PHP to connect to any SQL Server database.
How I configure PHP on Linux to use that extension? I use debian with
apache2 and PHP5 installed on it.
Waiting for your help,
Richard
____________________________________
Eduardo Ricardo Hernández Osorio
Técnico Telecomunicaciones Aeronáuticas
U.T.B Servicios Aeronáuticos, ECASA s.a.
Aeropuerto Internacional "Frank País García"
Tel: (53) (24) 474569
email: [EMAIL PROTECTED]
"...de buenas intenciones está empedrado el camino al infierno..."
--- End Message ---
--- Begin Message ---
Hi,
I think you should install at least
php5-mysql
and if you're using PEAR's db connection you'll need
php-db
too.
Robert
On Sa, Jul 14, 2007 at 10:39:40 -0400, Lic. Eduardo R. Hern?ndez Osorio wrote:
>
>
> Hi:
>
> I need use the SQL extension on PHP to connect to any SQL Server database.
> How I configure PHP on Linux to use that extension? I use debian with
> apache2 and PHP5 installed on it.
>
> Waiting for your help,
>
> Richard
>
>
>
> ____________________________________
>
> Eduardo Ricardo Hernández Osorio
>
> Técnico Telecomunicaciones Aeronáuticas
>
> U.T.B Servicios Aeronáuticos, ECASA s.a.
>
> Aeropuerto Internacional "Frank País García"
>
> Tel: (53) (24) 474569
>
>
>
> email: [EMAIL PROTECTED]
>
>
>
> "...de buenas intenciones está empedrado el camino al infierno..."
>
>
>
--- End Message ---
--- Begin Message ---
That's assuming he wanted specifically MySQL. The OP's post did not
actually state _which_ extension he wants to use, nor to which RDBMS he
wants to connect (at all). To the OP: SQL is simply a language, what you
want is a database-system which works with that language. There are a
lot of good DataBase Management Systems, of which MySQL is a commonly
available one.
- Tul
Robert Degen wrote:
Hi,
I think you should install at least
php5-mysql
and if you're using PEAR's db connection you'll need
php-db
too.
Robert
On Sa, Jul 14, 2007 at 10:39:40 -0400, Lic. Eduardo R. Hern?ndez Osorio wrote:
Hi:
I need use the SQL extension on PHP to connect to any SQL Server database.
How I configure PHP on Linux to use that extension? I use debian with
apache2 and PHP5 installed on it.
Waiting for your help,
Richard
____________________________________
Eduardo Ricardo Hernández Osorio
Técnico Telecomunicaciones Aeronáuticas
U.T.B Servicios Aeronáuticos, ECASA s.a.
Aeropuerto Internacional "Frank País García"
Tel: (53) (24) 474569
email: [EMAIL PROTECTED]
"...de buenas intenciones está empedrado el camino al infierno..."
--- End Message ---
--- Begin Message ---
The only way to do that is for each session to use a different session name
other than the default PHPSESSID as a session_id is tied to a particular
session_name, but then you would have to include a method of propagating
this new session name between pages in the same session, either through the
URL or a hidden field in each HTML form.
This is the technique that I use in the Radicore framework, as described in
http://www.tonymarston.net/php-mysql/client-clones.html
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
"Al" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a way to instigate 2 separate named session buffers? They will
> contain different data.
--- End Message ---