Re: [PHP] sorting multiple-dimensional arrays

2002-08-19 Thread Vehbi Sinan Tunalioglu

Have you ever heard data structures and algorithms? :o)

I recommend you to learn how people sort things in arrays. If you learn 
to sort things in a single dimensional array you will be able to learn 
how to sort the multi-dimensional array. People who have developed PHP 
do nothing more than this.

Try to start with buble-sort algorithm.
Search in google and you'll find lots of web sites which teach sort 
algorithms in C, which is very similar to PHP syntax, you know...

Sometimes, it is better to find custom solutions...
:o)

Have a nice day...

Vehbi Sinan Tunalioglu

Evan Nemerson wrote:

>I have an array that looks like
>
>$array = Array(
>   Array($var1, $var2, $var3),
>   Array($var1, $var2, $var3),
>   Array($var1, $var2, $var3)
>);
>
>I want to sort the arrays within $array by $var3 (although if it helps i can 
>easily change that to $var1). $var1 and $var2 are strings, $var3 is a number 
>(in form of ([0-9]{3}\.[0-9]) )
>
>I know i could put something together that would make a new, 
>single-dimensional array that looks like Array(var3, var3, var3...), sort 
>that, then use that as a reference point, but that's a really sloppy 
>approach, and I'm thinking probably not the best way.
>
>I have a feeling someone is just going to reply with only 
>"php.net/somefunction" in the body of their message, and I'll feel stupid, 
>but oh well. I can't find anything in the man.
>
>Any input would be appreciated.
>
>
>-Evan
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mail and attachments

2002-08-19 Thread Vehbi Sinan Tunalioglu

If you mean that you want to add attachments to emails it is possible of 
course...
Try Phpmailer...
I recommend you to print out a copy of this script and its helper class 
SMTP so that you can read it and modify (it is not required, guys have 
done everything well enough) and reuse it. You can do more than attach 
things into the mail...

http://phpmailer.sourceforge.net/

Have a nice day...
Vehbi Sinan Tunalioglu

Pafo wrote:

>i got a script that the user signs up on and send a profile to the owners
>email address
>but i want to implement a file upland and that the uploaded file should be
>submitted with the mail..
>
>is this possible in php?
>i know its possible in cg..
>
>regards
>patrick
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Garbage Collection?

2002-08-21 Thread Vehbi Sinan Tunalioglu

Hi everybody,

Is there any requirement to free variables in php, or is there any 
garbage collection or built-in module that terminates unused variables? 
(Especially for arrays and class instances)...

Have a nice day...
Vehbi Sinan Tunalioglu


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php