php-general Digest 16 Apr 2005 06:00:30 -0000 Issue 3400

Topics (messages 213153 through 213175):

Re: dynamic image will not print properly
        213153 by: DuSTiN KRySaK

Re: Amazon/eBay API
        213154 by: Matthew Fonda
        213161 by: Warren Vail
        213170 by: Manuel Lemos

Setting permissions such that file can be included but not open directly
        213155 by: Dasmeet Singh
        213157 by: Mike
        213159 by: Marek Kilimajer
        213163 by: Philip Hallstrom
        213175 by: Dasmeet Singh

Mysql insert problems
        213156 by: Frank Miller
        213158 by: John Nichel
        213162 by: Andy Pieters
        213164 by: Philip Hallstrom

Re: Streaming video BLOBs from MySQL
        213160 by: Marek Kilimajer

Re: php and linux shell script
        213165 by: Andy Pieters

create file download page for firefox using net-transport thru flashGot?
        213166 by: Ginger Cheng

con'td create file download page for firefox using net-transport thru flashGot?
        213167 by: Ginger Cheng

Font color
        213168 by: Ryan A
        213172 by: trlists.clayst.com
        213173 by: trlists.clayst.com

processing email
        213169 by: Florin Andrei
        213171 by: Manuel Lemos

Determining array type
        213174 by: NSK

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:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
I got it figured out finally!

It is so stupid with what the issue was...

My image was being created exactly as it should have been - and the code was fine. Now where my issue was: I had a line of code in there that was to prevent people from calling the script directly (had to be referred from a particular page). Well IE did not like that for printing. Even though the script acted exactly as it should have by design. I saved the image to my desktop to test it, and when opening in an image app - it would not even open (even though displaying fine in a browser). So I changed the file ext of the downloaded file to that of a text file and opened it... and what do you know - there was the error my php script generates when the page is not called properly.

So I removed that line of code (completely irrelevant to the image itself) And win/IE could print like all the other browsers could.

doh!

Dustin

On 14-Apr-05, at 5:41 PM, Richard Lynch wrote:


You'd want to http://php.net/urlencode the text, then.

<?php
  $text = "This is an example!";
  $text_url = urlencode($text);
  $url = "http://example.com/gd_script/text=$text_url/fool_ie.jpg";;
?>


On Wed, April 13, 2005 5:42 pm, DuSTiN KRySaK said:
One thing I feel is important to point out before I keep banging my
head off of the wall here...

In the URL parameter that is sent to the file, the url parameter is
just carrying text that is printed into the image. It is not actually
the image name, or anything. The image is generated in the cstl file
(which actually is the image - sends JPEG headers,etc) - with the text
on it (grabbed from the URL parameter).

d


On 13-Apr-05, at 5:03 PM, Richard Lynch wrote:

Yup.

$_PATH['x'] for the items that look like this: .../x=42/

And $PATH (without the underscore) is a string concatenation of all
elements (after the PHP script) that look like this /whatever/

So you might use something like a PHP script named 'scale' and then:

http://example.com/scale/width=100/height=100/images/subdir/ bigpic.jpg

and then you know that you want to scale the image in your
images/subdir
naemd bigpic.jpg down to 100x100 at maximum.

You'll have:
$_PATH['width'] -> 100
$_PATH['height'] -> 100
$PATH = '/images/subdir/bigpic.jpg'



On Tue, April 12, 2005 6:21 pm, DuSTiN KRySaK said:
And then all I should have to do is change my $_REQUESTS to $PATH in
hte cstl file right?


d


On 12-Apr-05, at 5:46 PM, Richard Lynch wrote:

On Mon, April 11, 2005 1:14 pm, DuSTiN KRySaK said:
hey - thanks a lot for the code snip - I am trying to use it now....

Just to confirm - the $path include file is included in the file
that
calls the cstl file - correct?

Yes.

Something like:

<?php require 'pathinfo.inc'; ?>

You can use this same technique for not just JPEG, but also PDF, SWF
(Ming) and FDF files, all of which Microsoft will screw up if you
don't
"fool" them with a URL that "looks" like static content.



d


On 5-Apr-05, at 5:57 PM, Richard Lynch wrote:

On Tue, April 5, 2005 2:26 pm, DuSTiN KRySaK said:
Hi there - I had my first crack at creating a dynamic image. The
thing
is - the image is displayed fine in the browser, but when you go
to
print it, the image is either missing, or part of it is missing.
Is
there something special needed to print a dynamic image?

What you did, *should* work just fine.

But we're talking *MICROSOFT* here!

These people do *NOT* follow standards.  Period.

Here is a code snippet used to create the image....

header("Content-type: image/jpg");
$image = imagecreatefromjpeg("template_cpn.jpg");
$red = imagecolorallocate( $image, 255,0,0 );
imagestring($image, 2, 306, 200, $couponcode, $red);
imagestring($image, 2, 306, 235, $exp, $red);
imagestring($image, 2, 175, 338, $myname, $red);
imagestring($image, 2, 175, 360, $myemail, $red);
imagejpeg($image);
imagedestroy($image);

Now the way I have it set up, is that there is a PHP file that
generates the image (the above code). Then I have a parent PHP
page
that calls that page like so:

$theurl = "cstl.php?dk=soemthinghere
echo "<img src=\"$theurl\">";

See any issues in my code or setup?

Any ideas?

Here's what you do: You make it *IMPOSSIBLE* for Microsoft to screw up.

This means you make your URL look JUST LIKE any other JPEG URL.

$theurl = "cstl/dk=somethinghere/whatever.jpg";

Step 1:
Add/Create an .htaccess file with this:
<Files cstl>
ForceType application/x-httpd-php
</Files>
This forces Apache to treat the file named 'cstl' as a PHP script.

Step 2:
Rename cstl.php to just 'cstl' (see Step 1)

Step 3:
Instead of using $_GET['dk'] do this:
$pathinfo = $_SERVER['PATH_INFO'];
$pathinfo = explode('/', $pathinfo);
//Key-Value pairs:
$_PATH = array();
//Path information buried in URL for source image sub-directories:
$PATH = array();
while (list(, $keyval) = each($pathinfo)){
$parts = explode('=', $keyval);
switch(count($parts)){
case 0: break; //do nothing with bogus extra '/' in URL
case 1: $PATH[] = $keyval;
default:
$key = $parts[0];
unset($parts[0]);
$_PATH[$key] = implode('=', $parts);
break;
}
}

Now you can use $_PATH['dk'] instead of $_GET['dk'] to get your dk
value
from the URL. You'll only change $_GET to $_PATH in cstl (formerly
cstl.php) and you're all set.

Now, there is *NO* *WAY* Microsoft can manage to screw up your URL
and
decide that it must not be a JPEG because it has GET data, or ends
in
.php
or whatever.

This same technique must be applied to PDF, FDF, SWF/Ming files if
you
want to avoid a zillion MS IE bugs related to multi-media.

So you might as well put the code for $_PATH/$PATH in an include
file.
 I
guarantee you'll need it again and again as you use more and more
multi-media in your web-site.

--
Like Music?
http://l-i-e.com/artists.htm





--
Like Music?
http://l-i-e.com/artists.htm





--
Like Music?
http://l-i-e.com/artists.htm





--
Like Music?
http://l-i-e.com/artists.htm


--- End Message ---
--- Begin Message --- Brian Dunning wrote:
Does anyone know of any PHP classes for processing the Amazon or eBay XML feeds?

There are two PEAR classes which handle both of these things, Services_Ebay and Services_Amazon.
--- End Message ---
--- Begin Message ---
There is a PHPNuke (web portal application) module that will allow you
to open an Amazon Store on your website.

NukeAmazon http://www.PrecioGasolina.com/

I'm still looking for an eBay feed, I think the barrier there is that I
heard eBay charges some big bucks to be able to access the interface.
Amazon on the other hand recognized the power of having a proliferation
of front-ends promoting and selling their products and provides access
pretty much for free (there are features you can pay extra for if you
are inclined).  

Don't know if eBay will ever come along.  Apple, even today, doesn't
recognize that IBM gained it's dominance by giving away its bios listing
and hardware specs (and some of its business) in the very beginning,
while apple looked at that type of move as giving away income it was
intitled to receive and jealously guarded it's monopoly, even sueing
vendors in some cases.  eBay probably feels they already have a monopoly
on auction sites and don't need to give their stuff away.

Warren Vail
[EMAIL PROTECTED]

> -----Original Message-----
> From: Brian Dunning [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 15, 2005 9:57 AM
> To: php-general@lists.php.net
> Subject: [PHP] Amazon/eBay API
> 
> 
> Does anyone know of any PHP classes for processing the Amazon or eBay 
> XML feeds?
> 
> - Brian
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

--- End Message ---
--- Begin Message ---
Hello,

on 04/15/2005 01:56 PM Brian Dunning said the following:
Does anyone know of any PHP classes for processing the Amazon or eBay XML feeds?

Here you may find classes to provide API to acess Web servers of many sites including Amazon and eBay.

http://www.phpclasses.org/browse/class/33.html

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message --- Hi!
I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves...

Is it possible to set folder permission such that files inside it cant be open directly but could be included?

thanks in advance :)


-- Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/

--- End Message ---
--- Begin Message ---
> directly to private/includefile.php can run the script 
> without authorising themselves...
> 
> Is it possible to set folder permission such that files 
> inside it cant be open directly but could be included?

Can you just give read permissions -only- to the user that PHP runs as and
not these other users?

-M

--- End Message ---
--- Begin Message --- Dasmeet Singh wrote:
Hi!
I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves...

Is it possible to set folder permission such that files inside it cant be open directly but could be included?

thanks in advance :)



In private/.htaccess put:

Order Deny,Allow
Deny from all

--- End Message ---
--- Begin Message ---
I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves...

Is it possible to set folder permission such that files inside it cant be open directly but could be included?


Configure apache to not allow access to the private directory... That will stop web browsers from getting there, but still allow your php script to include() a file within it.

Something like the below if you're using apache.  Other servers have
similar functionality...

<Location /url/to/private/directory>
    Order deny,allow
    Deny from all
</Location>

-philip
--- End Message ---
--- Begin Message --- Dasmeet Singh wrote:
Hi!
I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves...

Is it possible to set folder permission such that files inside it cant be open directly but could be included?

thanks in advance :)



.htaccess thing worked ..Thanks :)



Free cPanel Web Hosting
http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/

--- End Message ---
--- Begin Message ---
All, 

I have a form which submits technical requests. It worked fine on an
old linux box using Mysql 3 series but recently we switched to windows
2003 server SP1 using Mysql 4.1.10. It was doing this before the
service pack. I get the form values and then insert them into a table.
Sometimes it works and sometimes it dies. I don't know where to look
to fix this. Here is my code:

<?php 

$Email = $_POST['Email'];
$Phonenumber = $_POST['Phonenumber'];
$RoomNo = $_POST['RoomNo'];
$Situation = $_POST['Situation'];
$type = $_POST['type'];

if (!(  (empty($Phonenumber)== TRUE) || (empty($Email)== TRUE) ||
(is_email($Email) == false)  )   )
{
        $ip = $_SERVER['REMOTE_ADDR'];
        $DateRec = date("Y") ."-".date("m")."-".date("d");
        $TimeRec = date("H").":".date("i").":".date("s");
        // initialize database connection 
        include ('../../db.inc');
        $connection = mysql_connect($Host,$User,$Password) or
die("Invalid server or user");
        // select database 
 
        mysql_select_db("techsupport", $connection); 
 
        //formulate and run query 
        $query = "insert into
techsupport(Completed,Phonenumber,RoomNo,Email,Situation,DateRec,TimeRec,ip)
        
values('N','$Phonenumber','$RoomNo','$Email','$Situation','$DateRec','$TimeRec','$ip')";
 
        $result = mysql_query($query,$connection) or die("Couldn't
Insert into table techsupport");

        $WONumber = mysql_insert_id(); 

etc...

Any help would be appreciated.

Thanks - Frank

-- 
Frank Miller
Webmaster and Computer Specialist
Texas A&M Uiversity-Texarkana
Phone/Voice Mail 9032233156
Fax 9032233139
Web Page www.tamut.edu

--- End Message ---
--- Begin Message --- Frank Miller wrote:
All,

I have a form which submits technical requests. It worked fine on an
old linux box using Mysql 3 series but recently we switched to windows
2003 server SP1 using Mysql 4.1.10. It was doing this before the
service pack. I get the form values and then insert them into a table.
Sometimes it works and sometimes it dies. I don't know where to look
to fix this. Here is my code:

Search the archives for connecting to MySQL 4.1, and/or look at the MySQL manual.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hi

Whilst you are searching the net, you might also want to search for 'sql 
injection'.  This is no joke!

Please use the mysql_escape_string on each variable you get from the user 
side.

In your example

$Email = mysql_escape_string($_POST['Email']);
$Phonenumber = mysql_escape_string($_POST['Phonenumber']);

etc

There are some issues when magic quotes are turned on but you can implement a 
hack that corrects any consuequences of that (stripslashes)


Andy






-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>++++$@ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

--- End Message ---
--- Begin Message ---


On Fri, 15 Apr 2005, Frank Miller wrote:

All,

I have a form which submits technical requests. It worked fine on an
old linux box using Mysql 3 series but recently we switched to windows
2003 server SP1 using Mysql 4.1.10. It was doing this before the
service pack. I get the form values and then insert them into a table.
Sometimes it works and sometimes it dies. I don't know where to look
to fix this. Here is my code:

[snip]

Take a look at the following functions:

http://us4.php.net/manual/en/function.mysql-errno.php
http://us4.php.net/manual/en/function.mysql-error.php

and modify your die() statements (all of them) to include the output of these functions which might shed some light on exactly what the problem is when it's failing.

Good luck!

-philip
--- End Message ---
--- Begin Message --- J J wrote:
I have a case where video files (mov, flv, etc) have
been stored in a MySQL database as blobs.

I'm loading them into a flash video player and
everything works fine except it takes longer it seems
and it doesn't allow streaming the actual video.

If I load the same videos with a direct link to the
http:// file system (/videos/file.flv) it loads in
super-fast and allows streaming.

I'm guessing mysql and/or php doesn't actually release
the BLOB until it's loaded it completely.


So, is there a way to actually have PHP read the BLOB and stream it as it's loading? Is there an fstream() option like the fread()?

use mysql's SUBSTRING() function in a loop
--- End Message ---
--- Begin Message ---
On Friday 15 April 2005 08:52, Balwant Singh wrote:
> 2) i am also exploring possibilities of using linux dialog boxes (used in
> shell scripting) with PHP. has anybody tried it, may please advise me how
> to call dialog boxes through PHP in CLI. also please share with me if u
> have information on how to use PHP with Shell Scripting.
>

Hi

I like to think of PHP as a stream programming language.  You can use it to 
generate a stream of html documents, images, sound files, text files, etc etc 
etc.

So why shouldn't you use it to make your own dialogs in it as well?

Make an include file that contains the classes, then just declare your class 
and use it.

Like

$mydialog=new clsDialog;
$mydialog->type=DIALOGTYPE_INPUTBOX;
$mydialog->title="Provide some information";
$mydialog->regexp="$xxx^";

$result=$mydialog->showDialog();
unset($mydialog);

Off course the limitations are second to none!

I have released some PHP CLI scripts under the terms of GPL2 and they all use 
the same basic simple engine for argument processing.  It may not suit your 
needs, but you're welcome to study it to get you started.

With kind regards


Andy

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>++++$@ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

Attachment: sas_php_script.php
Description: application/php


--- End Message ---
--- Begin Message ---
Hello, PHP gurus,

       As a PHP newbie, I am trying to create a PHP page that generates and force dowload a file depending on user's input. Attached is the code.

       I give 's' to 'submit' and double checked that the value is correctly retried and the control flow is right.

       It works well if I use direct download of firefox or open the download file with an editor. It also works well with IE. But if I tried to download the file thru flashGot extension of firefox, which is connected to net-transport (an multi-thread download accelerator),  the name field has 'tmp' instead of the real file name. And the downloaded tmp has only the stderr saying that  '/var/tmp' can not be removed as it is a directory. But this flashGot works if I replace the variables with its real value.

       I tried to output the value of $filenm and it is correct. It must be sth that has to do with how this sort of download accelerator deals with HTML headers. Has anyone seen this problem before? can I have some hint?
       Thanks a lot

--- End Message ---
--- Begin Message ---
Hi, Here is the code

<?php

$filenm = '/var/tmp/';

$s = 1;
$q =2;


switch( $_POST["submit"] )
{
case 's':
$filenm .= 's.tab';
//create $filenm
break;
case 'q':
$filenm .= 'q.tab';
//create $filenm
break;
}

/*
echo "file name = {$filenm}<br>\n";
echo "base name = ", basename($filenm), "<br>\n";
echo "file size = ", filesize($filenm), "<br>\n";
echo "file name = {$filenm}<br>\n";
*/

$sname = basename($filenm);
header("Content-Type: application/octet-stream");
header('Content-Disposition: attachment; filename=' . $sname);
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.filesize($filenm));
readfile($filenm);

unlink($filenm);
?>


Thanks
--- End Message ---
--- Begin Message ---
Hey,
On our profiles page we are allowing the person to pick their own font color
and background image,
the font color is picked by a DHTML popup and displays "swatches" of color,
when the user picks the color she wants
its html RRGGBB value is automatically inserted...

Heres the problem....the profile is displayed like this (I'll use html code
so it will be easier to understand)

<b>Name:</b>
<i>Harry Houdini</i>

if they pick a light color for the <i>part</i> I want the <b> part</b> to be
the opposite...
eg: if they pick white I need the heading to be black and vice versa...any
way to do this?

Thanks,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 4/14/2005

--- End Message ---
--- Begin Message ---
On 16 Apr 2005 Ryan A wrote:

> eg: if they pick white I need the heading to be black and vice
> versa...any way to do this? 

Well it depends what you mean by "opposite", but as a starting approach 
I would try simply complementing the bits in the RGB value:

        $opposite_color = $original_color ^ 0xFFFFFF;

This will yield, for  example, all of the following, and their 
inverses:

        #000000 => #FFFFFF (black => white)
        #FF0000 => #00FFFF (red => cyan)
        #00FF00 => #FF00FF (green => magenta)
        #0000FF => #FFFF00 (blue => yellow)

--
Tom

--- End Message ---
--- Begin Message ---
Here is a little code that shows the "web-safe" colors and their 
"opposites" using the algorithm I described in the previous message:  

<html>
<head>
<title Web-safe color 'opposites'>
</head>
<body>
<?php

        # Display color opposites for web colors
        $weblist = array('00', '33', '66', '99', 'CC', 'FF');
        print("<table cols=\"4\" cellspacing=\"5\" cellpadding=\"0\">");
        print("<tr>\n");
        print("<th align=\"right\">Color</td>\n");
        print("<th width=\"100\" align=\"center\">Color swatch</td>\n");
        print("<th width=\"100\" align=\"center\">'Opposite' swatch</td>\n");
        print("<th align=\"left\">'Opposite' color</td>\n");
        print("</tr>\n");
        foreach ($weblist as $red) {
                foreach ($weblist as $green) {
                        foreach ($weblist as $blue) {
                                $hexcolor = $red . $green . $blue;
                                $hexoppcolor = sprintf("%06X", 
(hexdec($hexcolor) ^ 0xFFFFFF));
                                print("<tr>\n");
                                print("<td align=\"right\">#$hexcolor</td>\n");
                                print("<td width=\"100\" height=\"20\" 
bgcolor=\"#$hexcolor\">&nbsp;</td>\n");
                                print("<td width=\"100\" height=\"20\" 
bgcolor=\"#$hexoppcolor\">&nbsp;</td>\n");
                                print("<td 
align=\"left\">#$hexoppcolor</td>\n");
                                print("</tr>\n");
                        }
                }
        }
        print("</table>\n");
?>
</body>
</html>

--- End Message ---
--- Begin Message ---
I want to write an application that's almost like a webmail, but not
quite. It must receive emails from several mailing lists, store them in
a database, allow making annotations, provide some kind of accounts with
passwords, etc. It's quite specialized, it cannot be used as a webmail
proper, nor a webmail can be used instead (and that's why i'm writing
it).

But i do not want to reinvent the wheel. Are there any PHP libraries or
something to process email? E.g., for things like "here's the message,
separate the headers from the body and do something different with each
other item" or "find a discussion thread in these emails if i give you
the headers of each message". Things like that.

BTW, i will use PHP-4.3

-- 
Florin Andrei

http://florin.myip.org/

--- End Message ---
--- Begin Message ---
Hello,

on 04/15/2005 11:17 PM Florin Andrei said the following:
I want to write an application that's almost like a webmail, but not
quite. It must receive emails from several mailing lists, store them in
a database, allow making annotations, provide some kind of accounts with
passwords, etc. It's quite specialized, it cannot be used as a webmail
proper, nor a webmail can be used instead (and that's why i'm writing
it).

But i do not want to reinvent the wheel. Are there any PHP libraries or
something to process email? E.g., for things like "here's the message,
separate the headers from the body and do something different with each
other item" or "find a discussion thread in these emails if i give you
the headers of each message". Things like that.

BTW, i will use PHP-4.3

You may want to start to use POP3 to fetch any messages that you want to be processed. Here you may find one POP3 class for that purpose:

http://www.phpclasses.org/pop3class

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
We have two kinds of arrays in PHP:

$array["name"] = "George"

$array[0] = "George"

How can I determine (with a function returning true/false for example) which 
type of array I am working with?

-- 
NSK (Nikolaos S. Karastathis)
Personal Homepage at http://nsk.wikinerds.org/
Owner of http://portal.wikinerds.org
Owner of http://www.nerdypc.org

--- End Message ---

Reply via email to