|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help
lists.php.net
Date: Wed Oct 01 2008 - 17:36:18 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 1 Oct 2008 22:36:18 -0000 Issue 5713
Topics (messages 281268 through 281352):
store array into session variable and get it back later
281268 by: Alain Roger
281270 by: Per Jessen
281271 by: Stut
281274 by: Frank Arensmeier
281277 by: Alain Roger
281278 by: Alain Roger
281289 by: Thodoris
281304 by: Larry Brown
281327 by: Per Jessen
Re: PHP + Cron jobs
281269 by: Per Jessen
281272 by: Waynn Lue
281273 by: Per Jessen
Re: Sterilizing regexp
281275 by: tedd
281276 by: Eric Butera
script hangs on curl_exec
281279 by: Rene Veerman
281290 by: Robert Cummings
281291 by: Rene Veerman
mysql_query() vs query_database()
281280 by: Keith Spiller
281281 by: Jay Blanchard
photo file size
281282 by: elk dolk
281283 by: Maciek Sokolewicz
281284 by: Maciek Sokolewicz
281285 by: Boyd, Todd M.
281287 by: elk dolk
281288 by: Warren Vail
281293 by: Robert Cummings
281294 by: Robert Cummings
281296 by: Boyd, Todd M.
281299 by: Nathan Rixham
281308 by: Robert Cummings
281311 by: Ashley Sheridan
Mailing List fun
281286 by: Wolf
281292 by: Boyd, Todd M.
281295 by: Robert Cummings
281298 by: Boyd, Todd M.
281301 by: Daniel Brown
281309 by: Robert Cummings
281312 by: Ashley Sheridan
281315 by: Daniel Brown
281331 by: Robert Cummings
281333 by: Robert Cummings
281334 by: Jay Moore
281335 by: Robert Cummings
281337 by: Ashley Sheridan
281339 by: Robert Cummings
281341 by: tedd
281342 by: Daniel Brown
281343 by: tedd
281344 by: Jason Pruim
281350 by: Ashley Sheridan
Re: Robert Cummings
281297 by: Robert Cummings
281300 by: Robert Cummings
281302 by: Robert Cummings
281303 by: Daniel Brown
table with paging and sorting
281305 by: Alain Roger
281306 by: Alain Roger
281307 by: Nathan Rixham
problem with slash / characters
281310 by: Tanner Postert
281313 by: Ashley Sheridan
281317 by: Tanner Postert
281318 by: Al
281319 by: Ashley Sheridan
281320 by: Tanner Postert
281321 by: Tanner Postert
281323 by: Tanner Postert
SESSION array problems
281314 by: tedd
281322 by: Jay Moore
281324 by: Afan Pasalic
281325 by: tedd
281326 by: Shawn McKenzie
281328 by: Afan Pasalic
281329 by: Ashley Sheridan
281330 by: Afan Pasalic
281332 by: Shawn McKenzie
281336 by: tedd
281338 by: tedd
281340 by: tedd
281345 by: tedd
281346 by: Shawn McKenzie
281347 by: Afan Pasalic
281348 by: Henrik Hudson
281349 by: Nathan Rixham
281351 by: Nathan Rixham
281352 by: Nathan Rixham
Re: Mailing List fun 0T?
281316 by: Boyd, Todd M.
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
i have a 2 dim array defined as following:
class CBreadcrumb
> {
> // array holding the complete Breadcrumb
> var $crumb = array();
>
> /*
> * Constructor
> */
> function CBreadcrumb()
> {
>
> }
>
> /*
> * Add new stage
> */
> function Add($name, $link, $id)
> {
> array_push($this->crumb,array('name' => $name, 'link' => $link,
> 'id' => $id));
> }
> }
>
and its instance :
$bc = new CBreadcrumb();
>
> // filling the instance
> $bc->Add('Home',"https://www.myweb.com/framework/",0);
> $bc->Add('Language',"https://www.myweb.com/language/",1);
>
> // session must be started to store this breadcrumb
> $_SESSION['bc']=$bc;
>
later on i try to use the content of this array, bt without success.
Here is what i do:
$bci = array($_SESSION['bc']);
> array_push($bci,$_SESSION['bc']);
>
> foreach($bci as $key=>$value)
> {
> echo "bci : ".$bci[$key]['name'];
> echo "<br/>";
> }
>
how can i get the 'name' value for each row in this session stored array ?
thx.
--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
attached mail follows:
Alain Roger wrote:
> how can i get the 'name' value for each row in this session stored
> array ? thx.
You haven't stored an array in the session, you've tried to store an
object of class CBreadcrumb. Which AFAIK isn't supported.
/Per Jessen, Zürich
attached mail follows:
On 1 Oct 2008, at 11:40, Per Jessen wrote:
> Alain Roger wrote:
>
>> how can i get the 'name' value for each row in this session stored
>> array ? thx.
>
> You haven't stored an array in the session, you've tried to store an
> object of class CBreadcrumb. Which AFAIK isn't supported.
It is supported but you need to be careful about resources in the
class. You can handle these gracefully using the __sleep and __wake
magic methods. You also need to make sure the class has been loaded
before starting the session or have an __autoload defined.
-Stut
--
http://stut.net/
attached mail follows:
1 okt 2008 kl. 12.31 skrev Alain Roger:
...
>>
> later on i try to use the content of this array, bt without success.
> Here is what i do:
>
> $bci = array($_SESSION['bc']);
>> array_push($bci,$_SESSION['bc']);
>>
>> foreach($bci as $key=>$value)
>> {
>> echo "bci : ".$bci[$key]['name'];
>> echo "<br/>";
>> }
>>
>
> how can i get the 'name' value for each row in this session stored
> array ?
> thx.
>
...
The function you need to look into is called "serialize".
http://www.php.net/manual/en/function.serialize.php
//frank
attached mail follows:
On Wed, Oct 1, 2008 at 2:43 PM, Frank Arensmeier <frank
nikemedia.se> wrote:
> 1 okt 2008 kl. 12.31 skrev Alain Roger:
>
> ...
>
>>
>>>
> later on i try to use the content of this array, bt without success.
>> Here is what i do:
>>
>> $bci = array($_SESSION['bc']);
>>
>>> array_push($bci,$_SESSION['bc']);
>>>
>>> foreach($bci as $key=>$value)
>>> {
>>> echo "bci : ".$bci[$key]['name'];
>>> echo "<br/>";
>>> }
>>>
>>>
>> how can i get the 'name' value for each row in this session stored array ?
>> thx.
>>
>> ...
>
> The function you need to look into is called "serialize".
>
> http://www.php.net/manual/en/function.serialize.php
>
> //frank
>
This is what i did afterall, but when i unserialize it like this way:
$bci = unserialize($_SESSION['bc']);
foreach($bci as $key=>$value)
{
echo "bci : ".$key;
echo "<br/>";
}
i get absolutely the same result as the code below.
in fact $key returns me the 2 variables member of the Class. but not the
value stored inside them.
any idea ?
--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
attached mail follows:
>
>
>> later on i try to use the content of this array, bt without success.
>>> Here is what i do:
>>>
>>> $bci = array($_SESSION['bc']);
>>>
>>>> array_push($bci,$_SESSION['bc']);
>>>>
>>>> foreach($bci as $key=>$value)
>>>> {
>>>> echo "bci : ".$bci[$key]['name'];
>>>> echo "<br/>";
>>>> }
>>>>
>>>>
>>> how can i get the 'name' value for each row in this session stored array
>>> ?
>>> thx.
>>>
>>> ...
>>
>> The function you need to look into is called "serialize".
>>
>> http://www.php.net/manual/en/function.serialize.php
>>
>> //frank
>>
> This is what i did afterall, but when i unserialize it like this way:
> $bci = unserialize($_SESSION['bc']);
> foreach($bci as $key=>$value)
> {
> echo "bci : ".$key;
> echo "<br/>";
> }
>
> i get absolutely the same result as the code below.
> in fact $key returns me the 2 variables member of the Class. but not the
> value stored inside them.
> any idea ?
>
>
> so here is what i've decided to use:
for ($row=0;$row<=count($bci->crumb);$row++)
{
echo "<br/>value[$row]['name'] :
".$bci->crumb[$row]['name']."<br/>";
echo "<br/>value[$row]['link'] :
".$bci->crumb[$row]['link']."<br/>";
echo "<br/>value[$row]['id'] : ".$bci->crumb[$row]['id']."<br/>";
}
and it works like a charm.
but how can i optimize it ?
i mean foreach could do the work better ?
attached mail follows:
>>
>> This is what i did afterall, but when i unserialize it like this way:
>> $bci = unserialize($_SESSION['bc']);
>> foreach($bci as $key=>$value)
>> {
>> echo "bci : ".$key;
>> echo "<br/>";
>> }
>>
>> i get absolutely the same result as the code below.
>> in fact $key returns me the 2 variables member of the Class. but not the
>> value stored inside them.
>> any idea ?
>>
>>
>> so here is what i've decided to use:
>>
> for ($row=0;$row<=count($bci->crumb);$row++)
> {
> echo "<br/>value[$row]['name'] :
> ".$bci->crumb[$row]['name']."<br/>";
> echo "<br/>value[$row]['link'] :
> ".$bci->crumb[$row]['link']."<br/>";
> echo "<br/>value[$row]['id'] : ".$bci->crumb[$row]['id']."<br/>";
> }
> and it works like a charm.
> but how can i optimize it ?
> i mean foreach could do the work better ?
>
>
Since it is not necessary to store the object in the session at least
AFAIK I wonder why don't you just store a simple array.
You will not need to worry for anything.
--
Thodoris
attached mail follows:
how about:
$bci = $_SESSION['bc'];
foreach($bci->crumb as myCrumb)
{
echo "<br/>value['name'] :".$myCrumb['name']."<br/>";
echo "<br/>value['link'] :".$myCrumb['link']."<br/>";
echo "<br/>value['id'] : ".$myCrumb['id']."<br/>";
}
You are wanting to loop through the crumbs rather than looping objects.
There is only one object you are sending over through the session and
multiple crumbs right?
On Wed, 2008-10-01 at 17:04 +0200, Alain Roger wrote:
> >
> >
> >> later on i try to use the content of this array, bt without success.
> >>> Here is what i do:
> >>>
> >>> $bci = array($_SESSION['bc']);
> >>>
> >>>> array_push($bci,$_SESSION['bc']);
> >>>>
> >>>> foreach($bci as $key=>$value)
> >>>> {
> >>>> echo "bci : ".$bci[$key]['name'];
> >>>> echo "<br/>";
> >>>> }
> >>>>
> >>>>
> >>> how can i get the 'name' value for each row in this session stored array
> >>> ?
> >>> thx.
> >>>
> >>> ...
> >>
> >> The function you need to look into is called "serialize".
> >>
> >> http://www.php.net/manual/en/function.serialize.php
> >>
> >> //frank
> >>
> > This is what i did afterall, but when i unserialize it like this way:
> > $bci = unserialize($_SESSION['bc']);
> > foreach($bci as $key=>$value)
> > {
> > echo "bci : ".$key;
> > echo "<br/>";
> > }
> >
> > i get absolutely the same result as the code below.
> > in fact $key returns me the 2 variables member of the Class. but not the
> > value stored inside them.
> > any idea ?
> >
> >
> > so here is what i've decided to use:
> for ($row=0;$row<=count($bci->crumb);$row++)
> {
> echo "<br/>value[$row]['name'] :
> ".$bci->crumb[$row]['name']."<br/>";
> echo "<br/>value[$row]['link'] :
> ".$bci->crumb[$row]['link']."<br/>";
> echo "<br/>value[$row]['id'] : ".$bci->crumb[$row]['id']."<br/>";
> }
> and it works like a charm.
> but how can i optimize it ?
> i mean foreach could do the work better ?
attached mail follows:
Stut wrote:
> On 1 Oct 2008, at 11:40, Per Jessen wrote:
>
>> Alain Roger wrote:
>>
>>> how can i get the 'name' value for each row in this session stored
>>> array ? thx.
>>
>> You haven't stored an array in the session, you've tried to store an
>> object of class CBreadcrumb. Which AFAIK isn't supported.
>
> It is supported but you need to be careful about resources in the
> class. You can handle these gracefully using the __sleep and __wake
> magic methods. You also need to make sure the class has been loaded
> before starting the session or have an __autoload defined.
Thanks, I was not aware. Very clear and succinct explanation, btw.
/Per Jessen, Zürich
attached mail follows:
Waynn Lue wrote:
> Right, and I am, so I stayed away from that solution. My next
> attempt was to specify /usr/local/bin/php in the cron job, but that
> led to a problem because of the include paths. Now that I specific
> the full path, evidently the include path no longer is relative to the
> directory that's being executed from, and so it fails to execute. One
> solution is to also include the executing directory in the php script
> itself, I assume, but is there any better solution than that?
>
I would take a look at your core problem - why do you have php
executables in both /usr and /usr/local?
/Per Jessen, Zürich
attached mail follows:
Oh, I thought having one for cgi and one for cli was common. Do people
generally run only one, regardless of whether they're hitting it from
a webserver or running it from the commandline?
Thanks,
Waynn
On 10/1/08, Per Jessen <per
computer.org> wrote:
> Waynn Lue wrote:
>
>> Right, and I am, so I stayed away from that solution. My next
>> attempt was to specify /usr/local/bin/php in the cron job, but that
>> led to a problem because of the include paths. Now that I specific
>> the full path, evidently the include path no longer is relative to the
>> directory that's being executed from, and so it fails to execute. One
>> solution is to also include the executing directory in the php script
>> itself, I assume, but is there any better solution than that?
>>
>
> I would take a look at your core problem - why do you have php
> executables in both /usr and /usr/local?
>
>
> /Per Jessen, Zürich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Waynn Lue wrote:
> Oh, I thought having one for cgi and one for cli was common. Do people
> generally run only one, regardless of whether they're hitting it from
> a webserver or running it from the commandline?
I think the general setup is a php cli executable in /usr/bin/php and
the php apache module. I find it unusable to have php executables in
both /usr/bin and /usr/local/bin.
Obviously, if you're using all three variations - CLI, CGI and
module-based, you'll need two PHP executables, but I would still expect
to find those in /usr/bin with one called 'php' and the other
perhaps 'php-cgi'.
/Per Jessen, Zürich
attached mail follows:
At 8:53 AM +0200 10/1/08, Per Jessen wrote:
>Code elegance is usually in the eye of the beholder, but personally I
>would have stuck to a set of hardcoded preg_matches().
>
>/Per Jessen, Zürich
I agree, however with this caveat:
Code elegance is in the eye of the beholder. It
is usually painful and difficult to remove.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
On Wed, Oct 1, 2008 at 2:53 AM, Per Jessen <per
computer.org> wrote:
> Frank Stanovcak wrote:
>
>> I've got to pass about 9 or 10 calls to it, some of which will be
>> arrays, and I have to do it from several different places. Felt this
>> was a bit more elegant than hard coding the pregmatches unless there
>> is an easier way.
>
> Code elegance is usually in the eye of the beholder, but personally I
> would have stuck to a set of hardcoded preg_matches().
>
>
> /Per Jessen, Zürich
Just to throw out another option... I use a little input filter
validation library I wrote. I wanted to use something pre-existing
but I was stuck on php4 at the time so I modeled it after a few
different frameworks, specifically stubbles & solar.
Basically it works by creating classes that are filters. These
filters can be applied to any variable and they will either return the
variable upon validation success, null on failure, or a user defined
override default. Along with the filters are some helpers to create
composite filters to do simple AND's & OR's. I also have another one
for applying a filter to an array. There are also hooks into the
request object to apply these validation filters.
If I were to handle this case I could do this:
$array = $request->getFiltered(new my_InputFilter_ValidateArray(new
my_InputFilter_ValidateRegex('/regex/')), 'postkey',
my_Request::POST);
ValidateArray recursively applies the passed filter to all entries in
the array making sure the value matches.
attached mail follows:
I have a script that uses curl to call a worker function on another server.
For small workloads, it works just fine.
But when my script processes a large zip-file and updates some status
files, curl_exec never returns the result data even though the called
script does send it.
Any ideas?
attached mail follows:
On Wed, 2008-10-01 at 17:31 +0200, Rene Veerman wrote:
> I have a script that uses curl to call a worker function on another server.
> For small workloads, it works just fine.
>
> But when my script processes a large zip-file and updates some status
> files, curl_exec never returns the result data even though the called
> script does send it.
I would guess that the receiving script is having trouble. Perhaps it
isn't configured to receive a large amount of data? Or not enough
memory? Or exceeds runtime for script? Check of any of the following
php.ini settings are causing you grief for the receiving script.
max_execution_time = 30
memory_limit = 32M
upload_max_filesize = 5000000
post_max_size = 5000000
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
Robert Cummings wrote:
> On Wed, 2008-10-01 at 17:31 +0200, Rene Veerman wrote:
>
>> I have a script that uses curl to call a worker function on another server.
>> For small workloads, it works just fine.
>>
>> But when my script processes a large zip-file and updates some status
>> files, curl_exec never returns the result data even though the called
>> script does send it.
>>
>
> I would guess that the receiving script is having trouble. Perhaps it
> isn't configured to receive a large amount of data? Or not enough
> memory? Or exceeds runtime for script? Check of any of the following
> php.ini settings are causing you grief for the receiving script.
>
> max_execution_time = 30
> memory_limit = 32M
> upload_max_filesize = 5000000
> post_max_size = 5000000
>
> Cheers,
> Rob.
>
thx rob, but i dont think that's it. the scripts never deal with large
amounts of data directly, they just exec() unix zip binary and wait for
those results. the data sent between scripts is actually just the status
messages.
i've been able to get my operation to work by instituting a 3 minute
timeout and automated retry.
but it's far from ideal.
attached mail follows:
Hi,
RE: mysql_query() vs query_database()
What is the differences between mysql_query and query_database?
Are both compatible with PHP 5 and MySQL 5?
Is one faster than the other?
Thank you for your help.
Keith
attached mail follows:
[snip]
RE: mysql_query() vs query_database()
What is the differences between mysql_query and query_database?
Are both compatible with PHP 5 and MySQL 5?
Is one faster than the other?
[/snip]
query_database appears to be someone's function for generic database
queries and is not a part of the PHP functions as far as I can see.
attached mail follows:
Hi All,
I have some photos with different file sizes like 100KB 125KB 200KB ,…
I want to shrink them and reduce the
file size to Max 60KB without sacrificing image
quality and size!
PHP should have a solution for reducing the size of files in Batch. Please
comment.
thanks
attached mail follows:
elk dolk wrote:
>
>
>
> Hi All,
>
> I have some photos with different file sizes like 100KB 125KB 200KB ,…
> I want to shrink them and reduce the
> file size to Max 60KB without sacrificing image
> quality and size!
Without sacrificing size AND quality? So you don't want to lose enough
data to get to a max 60KB amount, without actually losing data... wow,
that won't be easy; or even better, it will probably not even be
possible. Changing formats makes the size smaller, but always loses some
detail/modifies the image slightly (eg. from bmp to png loses alot of
data, but unfortunately also some (little) quality).
So, decide which you want to sacrifice, and do it.
>
> PHP should have a solution for reducing the size of files in Batch.
it does, it's called writing a function and calling it for each of the
files in the batch.
> Please comment.
> thanks
Your request is unreasonable and should be better phrased :)
attached mail follows:
elk dolk wrote:
>
>
>
> Hi All,
>
> I have some photos with different file sizes like 100KB 125KB 200KB ,…
> I want to shrink them and reduce the
> file size to Max 60KB without sacrificing image
> quality and size!
Without sacrificing size AND quality? So you don't want to lose enough
data to get to a max 60KB amount, without actually losing data... wow,
that won't be easy; or even better, it will probably not even be
possible. Changing formats makes the size smaller, but always loses some
detail/modifies the image slightly (eg. from bmp to png loses alot of
data, but unfortunately also some (little) quality).
So, decide which you want to sacrifice, and do it.
>
> PHP should have a solution for reducing the size of files in Batch.
it does, it's called writing a function and calling it for each of the
files in the batch.
> Please comment.
> thanks
Your request is unreasonable and should be better phrased :)
attached mail follows:
> -----Original Message-----
> From: elk dolk [mailto:elkdolk
yahoo.com]
> Sent: Wednesday, October 01, 2008 11:26 AM
> To: php-general
lists.php.net
> Subject: [PHP] photo file size
>
> Hi All,
>
> I have some photos with different file sizes like 100KB 125KB 200KB
> ,...
> I want to shrink them and reduce the
> file size to Max 60KB without sacrificing image
> quality and size!
>
> PHP should have a solution for reducing the size of files in Batch.
> Please
> comment.
Well, your logic is flawed to begin with: reducing the file size will almost DEFINITELY reduce the image quality. It's not as if the image files have a bunch of useless data packed on to the end of them (though some have some strange compression algorithms that make for wacky data).
But... yes, there exist several PHP libraries that can probably do what you want to do. I suggest STFW for "ImageMagick" or "GD" with respect to PHP.
Good luck.
Todd Boyd
Web Programmer
attached mail follows:
>Without sacrificing size AND quality? So you don't want to lose enough
>data to get to a max 60KB amount, without actually losing data... wow,
>that won't be easy; or even better, it will probably not even be
>possible. Changing formats makes the size smaller, but always loses some
>detail/modifies the image slightly (eg. from bmp to png loses alot of
>data, but unfortunately also some (little) quality).
>So, decide which you want to sacrifice, and do it.
------------------------------------------------------------------------
O.K. for me file size is important I sacrifice quality!
attached mail follows:
The GD library has a number of functions that alter the size of an image,
and converting from one file type to another can sometimes be used to reduce
file size without reducing image size, but to do so it must give up detail
(i.e. image quality).
This is what is meant by the expression, "There is no such thing as a free
lunch".
You might think about this, if the images are being included in a web page,
it is unlikely that the user will be able to detect the difference between a
200KB and a 60KB image file size, unless there are lot's of them, or it's
over a dialup connection. With a high speed connection, the difference in
time required to download larger files can be under a second, and most users
will not notice a difference.
Everything is a compromise.
Warren Vail
> -----Original Message-----
> From: elk dolk [mailto:elkdolk
yahoo.com]
> Sent: Wednesday, October 01, 2008 9:26 AM
> To: php-general
lists.php.net
> Subject: [PHP] photo file size
>
>
>
>
>
> Hi All,
>
> I have some photos with different file sizes like 100KB
> 125KB 200KB ,… I want to shrink them and reduce the file
> size to Max 60KB without sacrificing image quality and size!
>
> PHP should have a solution for reducing the size of files in
> Batch. Please comment.
> thanks
>
>
>
>
>
>
>
attached mail follows:
On Wed, 2008-10-01 at 18:34 +0200, Maciek Sokolewicz wrote:
> elk dolk wrote:
> >
> >
> >
> > Hi All,
> >
> > I have some photos with different file sizes like 100KB 125KB 200KB ,…
> > I want to shrink them and reduce the
> > file size to Max 60KB without sacrificing image
> > quality and size!
>
> Without sacrificing size AND quality? So you don't want to lose enough
> data to get to a max 60KB amount, without actually losing data... wow,
> that won't be easy; or even better, it will probably not even be
> possible.
Maybe he has uncompressed bitmaps (yeah I know it's unlikely :)
> Changing formats makes the size smaller, but always loses some
> detail/modifies the image slightly (eg. from bmp to png loses alot of
> data, but unfortunately also some (little) quality).
>
> So, decide which you want to sacrifice, and do it.
Depedning on how his files are stored, he may get some extra compression
out of a PNG by upping the compression factor without quality
degradation. If he has uncompressed bitmaps he will benefit greatly. I
think I've found alos that jpg compresses better than gif (with 100%
quality setting). Beyond that a 5 to 10% quality loss on jpg is often
minimally adverse to the the visibility but strongly depends on what
kind of detail is in the picture.
> > PHP should have a solution for reducing the size of files in Batch.
> it does, it's called writing a function and calling it for each of the
> files in the batch.
>
>
> > Please comment.
> > thanks
> Your request is unreasonable and should be better phrased :)
Certainly could use some improvement.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Wed, 2008-10-01 at 09:44 -0700, Warren Vail wrote:
> The GD library has a number of functions that alter the size of an image,
> and converting from one file type to another can sometimes be used to reduce
> file size without reducing image size, but to do so it must give up detail
> (i.e. image quality).
>
> This is what is meant by the expression, "There is no such thing as a free
> lunch".
Sometimes though you can trade CPU time for space though. Hence why some
compression algorithms offer compression strength values. Look at gzip
for example. This absolutely has to be lossless, but you can get more
compression by upping the compression strength at the expense of CPU
time. Depending on one's usage this can certainly seem like a free
lunch :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
> -----Original Message-----
> From: Robert Cummings [mailto:robert
interjinn.com]
> Sent: Wednesday, October 01, 2008 11:54 AM
> To: Maciek Sokolewicz
> Cc: elkdolk
yahoo.com; php-general
lists.php.net
> Subject: Re: [PHP] Re: photo file size
>
> On Wed, 2008-10-01 at 18:34 +0200, Maciek Sokolewicz wrote:
> > elk dolk wrote:
> > >
> > >
> > >
> > > Hi All,
> > >
> > > I have some photos with different file sizes like 100KB 125KB
> 200KB ,…
> > > I want to shrink them and reduce the
> > > file size to Max 60KB without sacrificing image
> > > quality and size!
> >
> > Without sacrificing size AND quality? So you don't want to lose
> enough
> > data to get to a max 60KB amount, without actually losing data...
> wow,
> > that won't be easy; or even better, it will probably not even be
> > possible.
>
> Maybe he has uncompressed bitmaps (yeah I know it's unlikely :)
>
> > Changing formats makes the size smaller, but always loses some
> > detail/modifies the image slightly (eg. from bmp to png loses alot of
> > data, but unfortunately also some (little) quality).
> >
> > So, decide which you want to sacrifice, and do it.
>
> Depedning on how his files are stored, he may get some extra
> compression
> out of a PNG by upping the compression factor without quality
> degradation. If he has uncompressed bitmaps he will benefit greatly. I
> think I've found alos that jpg compresses better than gif (with 100%
> quality setting). Beyond that a 5 to 10% quality loss on jpg is often
> minimally adverse to the the visibility but strongly depends on what
> kind of detail is in the picture.
I was under the impression that .png files were "lossless"? Maybe I'm wrong... but the .png files I manipulate in a few of my projects are almost always larger than their other-format counterparts. I've only used .png in the past when transparency and lossless-ness (a new word!) are factors.
> > > PHP should have a solution for reducing the size of files in
> Batch.
> > it does, it's called writing a function and calling it for each of
> the
> > files in the batch.
Todd Boyd
Web Programmer
attached mail follows:
elk dolk wrote:
>
> Hi All,
>
> I have some photos with different file sizes like 100KB 125KB 200KB ,…
> I want to shrink them and reduce the
> file size to Max 60KB without sacrificing image
> quality and size!
>
amazon s3
--
nathan ( nathan
kraya.co.uk )
{
Senior Web Developer
php + java + flex + xmpp + xml + ecmascript
web development edinburgh | http://kraya.co.uk/
}
attached mail follows:
On Wed, 2008-10-01 at 11:57 -0500, Boyd, Todd M. wrote:
>
> I was under the impression that .png files were "lossless"? Maybe I'm wrong... but the .png files I manipulate in a few of my projects are almost always larger than their other-format counterparts. I've only used .png in the past when transparency and lossless-ness (a new word!) are factors.
Yes, I think it is lossless, but you have control over the strength of
the compression applied. I think PNG uses numbers between and and 9 to
indicate compression level. 9 takes more CPU power.
Chees,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Wed, 2008-10-01 at 18:00 +0100, Nathan Rixham wrote:
> elk dolk wrote:
> >
> > Hi All,
> >
> > I have some photos with different file sizes like 100KB 125KB 200KB ,…
> > I want to shrink them and reduce the
> > file size to Max 60KB without sacrificing image
> > quality and size!
> >
>
> amazon s3
>
> --
> nathan ( nathan
kraya.co.uk )
> {
> Senior Web Developer
> php + java + flex + xmpp + xml + ecmascript
> web development edinburgh | http://kraya.co.uk/
> }
>
It depends on what type of image they are. If it's a photo, go with JPEG
and play around with the compression. JPEG is always lossy (unless you
go JPEG 2000 which is not web-safe) but the loss is often not noticed by
the human eye. If it is a simple graphic then go with GIF or PNG
depending on the colours; <= 256 is GIF, otherwise go PNG. All of them
have various compression levels which you can use when you save them, so
play about and see what suits you best.
Ash
www.ashleysheridan.co.uk
attached mail follows:
Subject: OT: Mail service Restored
Who'd have thunk that a person who messes up a Time Warner account and WORKS in
Time Warner can disable your email accounts.
Not only that, but when they finally figure out what happened (3 phone calls,
over an hour on the phone with them), they are unable to restore the email
accounts until you drive home, reboot the router, call and WAIT ON HOLD for
their customer service reps and then another 10 minutes later get the email
accounts restored.
Sorry for the bounces everyone.
Wolf
Of course, after I sent that, I got an immediate failure message
=====================
This Message was undeliverable due to the following reason:
Your message was not delivered because the destination computer refused
to accept it (the error message is reproduced below). This type of error
is usually due to a mis-configured account or mail delivery system on the
destination computer; however, it could be caused by your message since
some mail systems refuse messages with invalid header information, or if
they are too large.
Your message was rejected by pair1.php.net for the following reason:
Apparent off-topic email rejected.
The following recipients did not receive this message:
<php-general
lists.php.net>
The following websites may contain more information to assist you:
http://help.rr.com/HMSLogic/rrmail.aspx
http://security.rr.com/help.htm
http://security.rr.com/contact.htm
Please do not reply to this message, as it will go to an unread
mailbox
Open Attachment 2 Open
--- Forwarded Message ---
Date:
[Wed, 1 Oct 2008 12:35:23 -0400]
From: Wolf <lonewolf
nc.rr.com>
To: php-general <php-general
lists.php.net>
attached mail follows:
> -----Original Message-----
> From: Wolf [mailto:lonewolf
nc.rr.com]
---8<--- snip!
Yeah... if you put OT anywhere in the topic, it rejects it automagically. I wondered why people were using zero-T (0T) instead; now I know. :) Seems kind of strange that going through the effort of flagging your own message as OT so that people can skip it rather than complain is rewarded with a bounce...
Se la vi.
Todd Boyd
Web Programmer
attached mail follows:
On Wed, 2008-10-01 at 11:50 -0500, Boyd, Todd M. wrote:
> > -----Original Message-----
> > From: Wolf [mailto:lonewolf
nc.rr.com]
>
> ---8<--- snip!
>
> Yeah... if you put OT anywhere in the topic, it rejects it automagically. I wondered why people were using zero-T (0T) instead; now I know. :) Seems kind of strange that going through the effort of flagging your own message as OT so that people can skip it rather than complain is rewarded with a bounce...
>
> Se la vi.
I'm sure you mean "C'est la vie!" here, unless that isn't French :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
> -----Original Message-----
> From: Robert Cummings [mailto:robert
interjinn.com]
> Sent: Wednesday, October 01, 2008 11:57 AM
> To: Boyd, Todd M.
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] Mailing List fun
>
> On Wed, 2008-10-01 at 11:50 -0500, Boyd, Todd M. wrote:
> > > -----Original Message-----
> > > From: Wolf [mailto:lonewolf
nc.rr.com]
> >
> > ---8<--- snip!
> >
> > Yeah... if you put OT anywhere in the topic, it rejects it
> automagically. I wondered why people were using zero-T (0T) instead;
> now I know. :) Seems kind of strange that going through the effort of
> flagging your own message as OT so that people can skip it rather than
> complain is rewarded with a bounce...
> >
> > Se la vi.
>
> I'm sure you mean "C'est la vie!" here, unless that isn't French :)
Spanish... but maybe I spelled something wrong. 5 years of Japanese and
26 years of bad English is all I've got under my belt. :) (Though, I at
least know that the "e" in "Se" needs an accent... but I'm not going to
go through my Character Map to find it.)
Also--follow-up to what you had posted earlier: there are .png
compression algorithms? I must get a hold of one and try to use it in a
side project of mine (that relies on .png for transparency, since .gif
has a limited palette and .jpg is not lossless).
Todd Boyd
Web Programmer
attached mail follows:
On Wed, Oct 1, 2008 at 12:56 PM, Robert Cummings <robert
interjinn.com> wrote:
>>
>> Se la vi.
>
> I'm sure you mean "C'est la vie!" here, unless that isn't French :)
He was referring to the editor, Vi. In a language known as
Peachpese, it is directly-translated as "see the editor." And, in the
context of editing his email, you'll see that it makes perfect sense.
--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.
attached mail follows:
On Wed, 2008-10-01 at 12:00 -0500, Boyd, Todd M. wrote:
> > -----Original Message-----
> > From: Robert Cummings [mailto:robert
interjinn.com]
> > Sent: Wednesday, October 01, 2008 11:57 AM
> > To: Boyd, Todd M.
> > Cc: php-general
lists.php.net
> > Subject: RE: [PHP] Mailing List fun
> >
> > On Wed, 2008-10-01 at 11:50 -0500, Boyd, Todd M. wrote:
> > > > -----Original Message-----
> > > > From: Wolf [mailto:lonewolf
nc.rr.com]
> > >
> > > ---8<--- snip!
> > >
> > > Yeah... if you put OT anywhere in the topic, it rejects it
> > automagically. I wondered why people were using zero-T (0T) instead;
> > now I know. :) Seems kind of strange that going through the effort of
> > flagging your own message as OT so that people can skip it rather than
> > complain is rewarded with a bounce...
> > >
> > > Se la vi.
> >
> > I'm sure you mean "C'est la vie!" here, unless that isn't French :)
>
> Spanish... but maybe I spelled something wrong. 5 years of Japanese and
> 26 years of bad English is all I've got under my belt. :) (Though, I at
> least know that the "e" in "Se" needs an accent... but I'm not going to
> go through my Character Map to find it.)
Ah Spanish... :)
> Also--follow-up to what you had posted earlier: there are .png
> compression algorithms? I must get a hold of one and try to use it in a
> side project of mine (that relies on .png for transparency, since .gif
> has a limited palette and .jpg is not lossless).
I believe jpg is lossless if you choose 100% quality.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Wed, 2008-10-01 at 14:12 -0400, Robert Cummings wrote:
> I believe jpg is lossless if you choose 100% quality.
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy, even at
100% quality. The nature of the algorithm is such that there is always
loss involved, which is why it's best to work on photos that are not in
JPEG format, as each save and re-open creates more and more distortion
(although not much that will be noticed in a photo!)
Ash
www.ashleysheridan.co.uk
attached mail follows:
On Wed, Oct 1, 2008 at 2:48 PM, Ashley Sheridan
<ash
ashleysheridan.co.uk> wrote:
> Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy, even at
> 100% quality. The nature of the algorithm is such that there is always
> loss involved, which is why it's best to work on photos that are not in
> JPEG format, as each save and re-open creates more and more distortion
> (although not much that will be noticed in a photo!)
Hey, you kids get this off-topic discussion off my lawn!
How many times do I have to remind you that this is a *PHP* list?
Don't I do well enough leading by example by never posting non-PHP
stuff to this list?
Good God....
--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.
attached mail follows:
On Wed, 2008-10-01 at 19:48 +0100, Ashley Sheridan wrote:
> On Wed, 2008-10-01 at 14:12 -0400, Robert Cummings wrote:
> > I believe jpg is lossless if you choose 100% quality.
> >
> > Cheers,
> > Rob.
> > --
> > http://www.interjinn.com
> > Application and Templating Framework for PHP
> Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy
I've never heard the term "web-safe" applied to images. What do you mean
by that? Lack of browser support? Breaks the web-safe 216 colour
palette?
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Wed, 2008-10-01 at 14:53 -0400, Daniel Brown wrote:
> On Wed, Oct 1, 2008 at 2:48 PM, Ashley Sheridan
> <ash
ashleysheridan.co.uk> wrote:
> > Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy, even at
> > 100% quality. The nature of the algorithm is such that there is always
> > loss involved, which is why it's best to work on photos that are not in
> > JPEG format, as each save and re-open creates more and more distortion
> > (although not much that will be noticed in a photo!)
>
> Hey, you kids get this off-topic discussion off my lawn!
Due to the recent trends in sub-prime mortgages... your lawn is now MY
lawn.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
Robert Cummings wrote:
> On Wed, 2008-10-01 at 19:48 +0100, Ashley Sheridan wrote:
>> On Wed, 2008-10-01 at 14:12 -0400, Robert Cummings wrote:
>>> I believe jpg is lossless if you choose 100% quality.
>>>
>>> Cheers,
>>> Rob.
>>> --
>>> http://www.interjinn.com
>>> Application and Templating Framework for PHP
>> Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy
>
> I've never heard the term "web-safe" applied to images. What do you mean
> by that? Lack of browser support? Breaks the web-safe 216 colour
> palette?
>
> Cheers,
> Rob.
I'd guess it means the filesize is ridiculously huge.
Jay
attached mail follows:
On Wed, 2008-10-01 at 14:53 -0400, Daniel Brown wrote:
> On Wed, Oct 1, 2008 at 2:48 PM, Ashley Sheridan
> <ash
ashleysheridan.co.uk> wrote:
> > Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy, even at
> > 100% quality. The nature of the algorithm is such that there is always
> > loss involved, which is why it's best to work on photos that are not in
> > JPEG format, as each save and re-open creates more and more distortion
> > (although not much that will be noticed in a photo!)
>
> Hey, you kids get this off-topic discussion off my lawn!
>
> How many times do I have to remind you that this is a *PHP* list?
> Don't I do well enough leading by example by never posting non-PHP
> stuff to this list?
>
> Good God....
BTW, to point out the obvious hypocrisy... you write this after starting
that huge off-topic discussion yesterday about some guy named Robert
Cummings and his new baby. Sheeeeeesh!! Get off my world!
;)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Wed, 2008-10-01 at 15:54 -0400, Robert Cummings wrote:
> On Wed, 2008-10-01 at 19:48 +0100, Ashley Sheridan wrote:
> > On Wed, 2008-10-01 at 14:12 -0400, Robert Cummings wrote:
> > > I believe jpg is lossless if you choose 100% quality.
> > >
> > > Cheers,
> > > Rob.
> > > --
> > > http://www.interjinn.com
> > > Application and Templating Framework for PHP
> > Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy
>
> I've never heard the term "web-safe" applied to images. What do you mean
> by that? Lack of browser support? Breaks the web-safe 216 colour
> palette?
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>
There are two types of JPEG, the normal ones, and the new 2000 format.
JPEG 2000 I believe supports CMYK and lossless compression, but the
images do not display on any browser I know of. This has caused a lot of
problems with CMS's that I've put together, as the images aren't
recognised by GD either, so I couldn't even change them. And a lot of
clients didn't even realise they were using the wrong type, as they were
just using the same images they use for print.
Ash
www.ashleysheridan.co.uk
attached mail follows:
On Wed, 2008-10-01 at 21:11 +0100, Ashley Sheridan wrote:
>
> There are two types of JPEG, the normal ones, and the new 2000 format.
> JPEG 2000 I believe supports CMYK and lossless compression, but the
> images do not display on any browser I know of. This has caused a lot of
> problems with CMS's that I've put together, as the images aren't
> recognised by GD either, so I couldn't even change them. And a lot of
> clients didn't even realise they were using the wrong type, as they were
> just using the same images they use for print.
Cool. Thanks for the lesson :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
At 3:54 PM -0400 10/1/08, Robert Cummings wrote:
>On Wed, 2008-10-01 at 19:48 +0100, Ashley Sheridan wrote:
>> On Wed, 2008-10-01 at 14:12 -0400, Robert Cummings wrote:
>> > I believe jpg is lossless if you choose 100% quality.
>> >
>> > Cheers,
>> > Rob.
>> > --
>> > http://www.interjinn.com
>> > Application and Templating Framework for PHP
>> Unless it's a JPEG 2000 (which isn't web-safe) then it's lossy
>
>I've never heard the term "web-safe" applied to images. What do you mean
>by that? Lack of browser support? Breaks the web-safe 216 colour
>palette?
>
>Cheers,
>Rob.
The term "web-safe" when applied to images was a misnomer -- there
was no such thing.
It originally pertained to certain colors that were consider staples
of browsers, such as red, white, blue, cornflowerblue, and so. I
think there was 256 of them -- but I may be wrong.
In any event, of those considered "web-safe" there were very few of
those that were actually the same color when viewed across different
browsers. So, truly "web-safe" colors were just a handful.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
On Wed, Oct 1, 2008 at 4:33 PM, tedd <tedd.sperling
gmail.com> wrote:
>
> The term "web-safe" when applied to images was a misnomer -- there was no
> such thing.
>
> It originally pertained to certain colors that were consider staples of
> browsers, such as red, white, blue, cornflowerblue, and so. I think there
> was 256 of them -- but I may be wrong.
What's wrong with everyone? No one has yet thrown out a Wikipedia
link. I know damn well that some of you looked it up!
--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.
attached mail follows:
At 4:36 PM -0400 10/1/08, Daniel Brown wrote:
>On Wed, Oct 1, 2008 at 4:33 PM, tedd <tedd.sperling
gmail.com> wrote:
>>
>> The term "web-safe" when applied to images was a misnomer -- there was no
>> such thing.
>>
>> It originally pertained to certain colors that were consider staples of
>> browsers, such as red, white, blue, cornflowerblue, and so. I think there
>> was 256 of them -- but I may be wrong.
>
> What's wrong with everyone? No one has yet thrown out a Wikipedia
>link. I know damn well that some of you looked it up!
>
Here's a link that explains what people used to think.
http://www.permadi.com/tutorial/websafecolor/
But that's not the way it actually is.
There has been a more exhaustive study of those colors and it was
discovered that very few of those colors were "web-safe" (i.e., no
differences in color) across different browsers.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
On Oct 1, 2008, at 4:36 PM, Daniel Brown wrote:
> On Wed, Oct 1, 2008 at 4:33 PM, tedd <tedd.sperling
gmail.com> wrote:
>>
>> The term "web-safe" when applied to images was a misnomer -- there
>> was no
>> such thing.
>>
>> It originally pertained to certain colors that were consider
>> staples of
>> browsers, such as red, white, blue, cornflowerblue, and so. I think
>> there
>> was 256 of them -- but I may be wrong.
>
> What's wrong with everyone? No one has yet thrown out a Wikipedia
> link. I know damn well that some of you looked it up!
We are waiting for you to get off your lazy ass and do some work for
us! :P
attached mail follows:
On Wed, 2008-10-01 at 16:52 -0400, Jason Pruim wrote:
> On Oct 1, 2008, at 4:36 PM, Daniel Brown wrote:
>
> > On Wed, Oct 1, 2008 at 4:33 PM, tedd <tedd.sperling
gmail.com> wrote:
> >>
> >> The term "web-safe" when applied to images was a misnomer -- there
> >> was no
> >> such thing.
> >>
> >> It originally pertained to certain colors that were consider
> >> staples of
> >> browsers, such as red, white, blue, cornflowerblue, and so. I think
> >> there
> >> was 256 of them -- but I may be wrong.
> >
> > What's wrong with everyone? No one has yet thrown out a Wikipedia
> > link. I know damn well that some of you looked it up!
>
> We are waiting for you to get off your lazy ass and do some work for
> us! :P
>
>
When I said web-safe images, I didn't mean images that were in web-safe
colours. You all know that browsers can only be relied upon to display
jpeg, gif and png images. Well, jpeg has 2 formats, one that browsers
can display (web-safe) and one that browsers can't (jpeg 2000 not
web-safe).
I hope this clears things up?
Ash
www.ashleysheridan.co.uk
attached mail follows:
On Tue, 2008-09-30 at 18:01 -0400, Daniel Brown wrote:
> On Tue, Sep 30, 2008 at 5:43 PM, Robert Cummings <robert
interjinn.com> wrote:
> >
> > Thanks for the congrats. No need to visit the hospital, this time round
> > my wife was able to get a midwife and so the baby was delivered in the
> > comfort of our home :)
>
> And I'm sure you looked just lovely in that flowery dress while
> you performed those duties, Rob. ;-P
I need to be flexible so to keep my movement free I'm just wearing
leather chaps.
Did you conjure up a mental image? I'm sorry if you did ;)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Tue, 2008-09-30 at 17:59 -0500, Ray Hauge wrote:
> Daniel Brown wrote:
> > All:
> >
> > What was pointed as a passing mention in one thread I thought was
> > worth note in a thread of its own. As quoted by Rob:
> >
> >> BTW, while we're off topic... my wife delivered our third child (second
> >> boy) 3 minutes after midnight yesterday :)
> >
> > I'd say that deserves a round of congratulations. Many - most,
> > probably - of you know Rob from here, and have seen his help and
> > dedication - as well as his annoying wit ;-P - offered to any and all
> > on this list. Quite often, it's offered when you don't especially
> > want it. Nonetheless, it's great news, and I think we should all take
> > a moment and wonder: why the hell aren't you at the hospital with your
> > wife and newborn son, Rob? ;-P
> >
> > Congrats to the Cummings family!
> >
>
> Oh wow, congrats Rob! We just had our second (and last after my
> surgery) 5 months ago.
Congratulations to you also! We're keeping our options open for a couple
more years, then either another will be forthcoming or I'll be going for
a similar operation :)
> Enjoy the lack of sleep :)
We're not too worried. Our first cried excessively and honed our coping
skills. Our second was a breeze, and so far this one is looking like a
breeze also. We feel sorry for people whose first is easy then they get
hit up with something like our first.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Wed, 2008-10-01 at 07:41 +0800, paragasu wrote:
> i don't wan't to go off without saying congrats to Rob too!
> congrats Rob.. i am quite amazed that PHP mailing list is the first
> thing in your mind
> after receiving that news.
Well not the first thing... but one does need to relax and I find
jumping on the list to be relaxing. It's like coding... I do it for a
hobby as well as for work :)
> I wonder what is your son name?
> btw, Zend is a good name ;)
Nah, nothing so exotic :) Sarah and I have been keeping to a
Scottish/Irish naming scheme. We currently have Keiran (newborn), Fiona
(2.5 years), and Colin (~5 years).
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Wed, Oct 1, 2008 at 1:08 PM, Robert Cummings <robert
interjinn.com> wrote:
>
> Nah, nothing so exotic :) Sarah and I have been keeping to a
> Scottish/Irish naming scheme. We currently have Keiran (newborn), Fiona
> (2.5 years), and Colin (~5 years).
Ah, good Gaelic names. Go mbeannaí Dia páiste!
--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.
attached mail follows:
Hi,
i used in the past a former version of Pear package to create table with
pagination and sorting.
i would like to know if there are some other solution (free) to do something
like this one : <a href="
http://s220.photobucket.com/albums/dd277/alainroger/development/?action=view¤t=example-table.gif"
target="_blank"><img src="
http://i220.photobucket.com/albums/dd277/alainroger/development/example-table.gif"
border="0" alt="web table with pagination and sorting"></a> ?
thx.
--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
attached mail follows:
sorry here is the link
http://i220.photobucket.com/albums/dd277/alainroger/development/example-table.gif
---------- Forwarded message ----------
From: Alain Roger <raf.news
gmail.com>
Date: Wed, Oct 1, 2008 at 7:34 PM
Subject: table with paging and sorting
To: PHP General List <php-general
lists.php.net>
Hi,
i used in the past a former version of Pear package to create table with
pagination and sorting.
i would like to know if there are some other solution (free) to do something
like this one : <a href="
http://s220.photobucket.com/albums/dd277/alainroger/development/?action=view¤t=example-table.gif"
target="_blank"><img src="
http://i220.photobucket.com/albums/dd277/alainroger/development/example-table.gif"
border="0" alt="web table with pagination and sorting"></a> ?
thx.
--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
attached mail follows:
Alain Roger wrote:
> i used in the past a former version of Pear package to create table with
> pagination and sorting.
> i would like to know if there are some other solution (free) to do something
> like this...
>
on the clientside you have YUI Tables for the html/js solution and Flex
Datagrids if you want to go down the E4X+Flash route (v easy + looks
great + v functional)
as for php.. not sure!
--
nathan ( nathan
kraya.co.uk )
{
Senior Web Developer
php + java + flex + xmpp + xml + ecmascript
web development edinburgh | http://kraya.co.uk/
}
attached mail follows:
I'm pulling a value from a database, and adding it to an array.
The values come from the database like this:
[0]
attached mail follows:
On Wed, 2008-10-01 at 11:40 -0700, Tanner Postert wrote:
> I'm pulling a value from a database, and adding it to an array.
>
> The values come from the database like this:
>
> [0]
Erm... I think you may need to repost this question!
Ash
www.ashleysheridan.co.uk
attached mail follows:
ignore previous. sorry.
I'm trying to display values from a database, the values come from the
database like this:
[0] => Array
(
[id] => 5
[order_id] => 10
[key] => ship_to_name
[value] => John Anderson
)
[1] => Array
(
[id] => 6
[order_id] => 10
[key] => ship_to_address
[value] => c/o Company XYZ
)
etc.
so i am rolling thru that array and making a new array by:
foreach ( $data as $k = $v ) {
$new[$v['key']] = $v['value'];
}
so that i have 1 array.
The problem is that somewhere along the way the string "c/o Company XYZ" is
becoming c/1 Company XYZ.
I added a print_r after every iteration to see what its looking like along
the way:
foreach( $data as $k=>$v ) {
error_log( "new" . $v['key'] . " = " . $v['value'] );
$new[$v['key']] = $v['value'];
error_log( print_r( $new, true ) );
}
and I get:
new ship_to_name = Gordon Anderson
Array
(
[ship_to_name] => Gordon Anderson
)
new ship_to_address = c/o Company XYZ
Array
(
[ship_to_name] => Gordon Anderson
[ship_to_address] => c/o Company XYZ
)
new ship_to_address_2 = 1100 S Baldwin
Array
(
[ship_to_name] => Gordon Anderson
[ship_to_address] => c/o Company XYZ
[ship_to_address_2] => 1100 S Baldwin
)
new ship_to_city = Oxford
Array
(
[ship_to_name] => Gordon Anderson
[ship_to_address] => c/1 Company XYZ
[ship_to_address_2] => 1100 S Baldwin
[ship_to_city] => Oxford
)
... and it looks the same for the remaining iterations.
how did the string change in the middle of that for loop?
This also only happens on one machine. the production environment, which his
Redhat, it doesn't happen on my development env, which is Fedora 9.
Thanks in advance.
attached mail follows:
Tanner Postert wrote:
> ignore previous. sorry.
>
> I'm trying to display values from a database, the values come from the
> database like this:
>
> [0] => Array
> (
> [id] => 5
> [order_id] => 10
> [key] => ship_to_name
> [value] => John Anderson
> )
> [1] => Array
> (
> [id] => 6
> [order_id] => 10
> [key] => ship_to_address
> [value] => c/o Company XYZ
> )
>
> etc.
>
> so i am rolling thru that array and making a new array by:
>
> foreach ( $data as $k = $v ) {
> $new[$v['key']] = $v['value'];
> }
> so that i have 1 array.
>
> The problem is that somewhere along the way the string "c/o Company XYZ" is
> becoming c/1 Company XYZ.
>
> I added a print_r after every iteration to see what its looking like along
> the way:
>
> foreach( $data as $k=>$v ) {
> error_log( "new" . $v['key'] . " = " . $v['value'] );
> $new[$v['key']] = $v['value'];
> error_log( print_r( $new, true ) );
> }
>
> and I get:
>
> new ship_to_name = Gordon Anderson
> Array
> (
> [ship_to_name] => Gordon Anderson
> )
> new ship_to_address = c/o Company XYZ
> Array
> (
> [ship_to_name] => Gordon Anderson
> [ship_to_address] => c/o Company XYZ
> )
> new ship_to_address_2 = 1100 S Baldwin
> Array
> (
> [ship_to_name] => Gordon Anderson
> [ship_to_address] => c/o Company XYZ
> [ship_to_address_2] => 1100 S Baldwin
> )
> new ship_to_city = Oxford
> Array
> (
> [ship_to_name] => Gordon Anderson
> [ship_to_address] => c/1 Company XYZ
> [ship_to_address_2] => 1100 S Baldwin
> [ship_to_city] => Oxford
> )
> ... and it looks the same for the remaining iterations.
>
>
> how did the string change in the middle of that for loop?
>
> This also only happens on one machine. the production environment, which his
> Redhat, it doesn't happen on my development env, which is Fedora 9.
>
> Thanks in advance.
>
What happens if you change the "/" to another character, e.g., "#"?
attached mail follows:
On Wed, 2008-10-01 at 12:02 -0700, Tanner Postert wrote:
> ignore previous. sorry.
>
> I'm trying to display values from a database, the values come from the
> database like this:
>
> [0] => Array
> (
> [id] => 5
> [order_id] => 10
> [key] => ship_to_name
> [value] => John Anderson
> )
> [1] => Array
> (
> [id] => 6
> [order_id] => 10
> [key] => ship_to_address
> [value] => c/o Company XYZ
> )
>
> etc.
>
> so i am rolling thru that array and making a new array by:
>
> foreach ( $data as $k = $v ) {
> $new[$v['key']] = $v['value'];
> }
> so that i have 1 array.
>
> The problem is that somewhere along the way the string "c/o Company XYZ" is
> becoming c/1 Company XYZ.
>
> I added a print_r after every iteration to see what its looking like along
> the way:
>
> foreach( $data as $k=>$v ) {
> error_log( "new" . $v['key'] . " = " . $v['value'] );
> $new[$v['key']] = $v['value'];
> error_log( print_r( $new, true ) );
> }
>
> and I get:
>
> new ship_to_name = Gordon Anderson
> Array
> (
> [ship_to_name] => Gordon Anderson
> )
> new ship_to_address = c/o Company XYZ
> Array
> (
> [ship_to_name] => Gordon Anderson
> [ship_to_address] => c/o Company XYZ
> )
> new ship_to_address_2 = 1100 S Baldwin
> Array
> (
> [ship_to_name] => Gordon Anderson
> [ship_to_address] => c/o Company XYZ
> [ship_to_address_2] => 1100 S Baldwin
> )
> new ship_to_city = Oxford
> Array
> (
> [ship_to_name] => Gordon Anderson
> [ship_to_address] => c/1 Company XYZ
> [ship_to_address_2] => 1100 S Baldwin
> [ship_to_city] => Oxford
> )
> ... and it looks the same for the remaining iterations.
>
>
> how did the string change in the middle of that for loop?
>
> This also only happens on one machine. the production environment, which his
> Redhat, it doesn't happen on my development env, which is Fedora 9.
>
> Thanks in advance.
So you're saying it changes for some values returned from the database
and not others? Is there anything particularly different about the ones
that are being returned? Are you sure that the database has the correct
values?
Ash
www.ashleysheridan.co.uk
attached mail follows:
very, strange.
if I change it to c / o Company XYZ ( with spaces between each character) it
becomes: c 1 o Company XYZ.
if I change it to c#o Company XYZ it becomes c1o Company XYZ
On Wed, Oct 1, 2008 at 12:16 PM, Al <news
ridersite.org> wrote:
>
>
> Tanner Postert wrote:
>
>> ignore previous. sorry.
>>
>> I'm trying to display values from a database, the values come from the
>> database like this:
>>
>> [0] => Array
>> (
>> [id] => 5
>> [order_id] => 10
>> [key] => ship_to_name
>> [value] => John Anderson
>> )
>> [1] => Array
>> (
>> [id] => 6
>> [order_id] => 10
>> [key] => ship_to_address
>> [value] => c/o Company XYZ
>> )
>>
>> etc.
>>
>> so i am rolling thru that array and making a new array by:
>>
>> foreach ( $data as $k = $v ) {
>> $new[$v['key']] = $v['value'];
>> }
>> so that i have 1 array.
>>
>> The problem is that somewhere along the way the string "c/o Company XYZ"
>> is
>> becoming c/1 Company XYZ.
>>
>> I added a print_r after every iteration to see what its looking like along
>> the way:
>>
>> foreach( $data as $k=>$v ) {
>> error_log( "new" . $v['key'] . " = " . $v['value'] );
>> $new[$v['key']] = $v['value'];
>> error_log( print_r( $new, true ) );
>> }
>>
>> and I get:
>>
>> new ship_to_name = Gordon Anderson
>> Array
>> (
>> [ship_to_name] => Gordon Anderson
>> )
>> new ship_to_address = c/o Company XYZ
>> Array
>> (
>> [ship_to_name] => Gordon Anderson
>> [ship_to_address] => c/o Company XYZ
>> )
>> new ship_to_address_2 = 1100 S Baldwin
>> Array
>> (
>> [ship_to_name] => Gordon Anderson
>> [ship_to_address] => c/o Company XYZ
>> [ship_to_address_2] => 1100 S Baldwin
>> )
>> new ship_to_city = Oxford
>> Array
>> (
>> [ship_to_name] => Gordon Anderson
>> [ship_to_address] => c/1 Company XYZ
>> [ship_to_address_2] => 1100 S Baldwin
>> [ship_to_city] => Oxford
>> )
>> ... and it looks the same for the remaining iterations.
>>
>>
>> how did the string change in the middle of that for loop?
>>
>> This also only happens on one machine. the production environment, which
>> his
>> Redhat, it doesn't happen on my development env, which is Fedora 9.
>>
>> Thanks in advance.
>>
>>
> What happens if you change the "/" to another character, e.g., "#"?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
just did some further testing, and even if I remove the special characters,
the 3rd character in that string becomes a 1.
I change it to Company XYZ,
and it looks right when its assigned to the array the first time, and on the
next iteration of the loop. but after that, it looks lke Co1pany XYZ.
On Wed, Oct 1, 2008 at 12:18 PM, Tanner Postert <tanner.postert
gmail.com>wrote:
> very, strange.
>
> if I change it to c / o Company XYZ ( with spaces between each character)
> it becomes: c 1 o Company XYZ.
> if I change it to c#o Company XYZ it becomes c1o Company XYZ
>
>
> On Wed, Oct 1, 2008 at 12:16 PM, Al <news
ridersite.org> wrote:
>
>>
>>
>> Tanner Postert wrote:
>>
>>> ignore previous. sorry.
>>>
>>> I'm trying to display values from a database, the values come from the
>>> database like this:
>>>
>>> [0] => Array
>>> (
>>> [id] => 5
>>> [order_id] => 10
>>> [key] => ship_to_name
>>> [value] => John Anderson
>>> )
>>> [1] => Array
>>> (
>>> [id] => 6
>>> [order_id] => 10
>>> [key] => ship_to_address
>>> [value] => c/o Company XYZ
>>> )
>>>
>>> etc.
>>>
>>> so i am rolling thru that array and making a new array by:
>>>
>>> foreach ( $data as $k = $v ) {
>>> $new[$v['key']] = $v['value'];
>>> }
>>> so that i have 1 array.
>>>
>>> The problem is that somewhere along the way the string "c/o Company XYZ"
>>> is
>>> becoming c/1 Company XYZ.
>>>
>>> I added a print_r after every iteration to see what its looking like
>>> along
>>> the way:
>>>
>>> foreach( $data as $k=>$v ) {
>>> error_log( "new" . $v['key'] . " = " . $v['value'] );
>>> $new[$v['key']] = $v['value'];
>>> error_log( print_r( $new, true ) );
>>> }
>>>
>>> and I get:
>>>
>>> new ship_to_name = Gordon Anderson
>>> Array
>>> (
>>> [ship_to_name] => Gordon Anderson
>>> )
>>> new ship_to_address = c/o Company XYZ
>>> Array
>>> (
>>> [ship_to_name] => Gordon Anderson
>>> [ship_to_address] => c/o Company XYZ
>>> )
>>> new ship_to_address_2 = 1100 S Baldwin
>>> Array
>>> (
>>> [ship_to_name] => Gordon Anderson
>>> [ship_to_address] => c/o Company XYZ
>>> [ship_to_address_2] => 1100 S Baldwin
>>> )
>>> new ship_to_city = Oxford
>>> Array
>>> (
>>> [ship_to_name] => Gordon Anderson
>>> [ship_to_address] => c/1 Company XYZ
>>> [ship_to_address_2] => 1100 S Baldwin
>>> [ship_to_city] => Oxford
>>> )
>>> ... and it looks the same for the remaining iterations.
>>>
>>>
>>> how did the string change in the middle of that for loop?
>>>
>>> This also only happens on one machine. the production environment, which
>>> his
>>> Redhat, it doesn't happen on my development env, which is Fedora 9.
>>>
>>> Thanks in advance.
>>>
>>>
>> What happens if you change the "/" to another character, e.g., "#"?
>>
>> --
<