php-general Digest 26 Jun 2009 12:41:31 -0000 Issue 6196

Topics (messages 294623 through 294638):

Re: point me to functions to parse the URL? (best one for *this* job?)
        294623 by: Shawn McKenzie
        294624 by: Shawn McKenzie
        294625 by: Shawn McKenzie
        294634 by: Nisse Engström

Does php have multithread, shared object(like jsp application)
        294626 by: WenDong Zhang
        294627 by: Eddie Drapkin
        294629 by: HallMarc Websites

Regarding Accesing mp3 with php
        294628 by: Gautam Bhatia

This Friday's OT Thread
        294630 by: Björn Bartels
        294637 by: Robert Cummings
        294638 by: Tom Worster

What does this mean?
        294631 by: Jason Carson
        294632 by: Eddie Drapkin

Re: PHP doesn't see php.ini
        294633 by: Arno Kuhl

Re: idiot proofing
        294635 by: Manuel Lemos

Re: How to sort a two-D ARRAY
        294636 by: Isataev Volodymir

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Govinda wrote:
> Hi all,
> 
> (PHP newbie here.  Newbie-level task to match.)
> 
> I am RTFM and working on this..  but I am also under deadline, so, I ask
> you in case you can point me quick where to read...  what functions I
> need to use for this.
> 
> Incoming URL will look like these, for example:
> 
> domain.com/unix/asdfsdf.html
> domain.com/macos/khsdfg.html
> 
> I need to parse those URLs and set the value of $myfolder to as follows:
> 
> domain.com/unix/asdfsdf.html
> $myfolder=unix
> domain.com/macos/khsdfg.html
> $myfolder=macos
> 
> BUT if there is no dir/ in between the domain and file,
> like so:
> domain.com/khsdfg.html
>  then I want:
> $myfolder=default
> 
> I am playing with $_SERVER['PATH_TRANSLATED'], ..
> what function will parse that best?
> I need to also account for when the URL does not have an in-between
> dir/, nor a filename in it, e.g.:
> domain.com/
> (then again $myfolder=default)
> 
> TIA!
> -Govinda

No way, you want to "parse" the "url"?

How about, parse_url()?

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:
> Govinda wrote:
>> Hi all,
>>
>> (PHP newbie here.  Newbie-level task to match.)
>>
>> I am RTFM and working on this..  but I am also under deadline, so, I ask
>> you in case you can point me quick where to read...  what functions I
>> need to use for this.
>>
>> Incoming URL will look like these, for example:
>>
>> domain.com/unix/asdfsdf.html
>> domain.com/macos/khsdfg.html
>>
>> I need to parse those URLs and set the value of $myfolder to as follows:
>>
>> domain.com/unix/asdfsdf.html
>> $myfolder=unix
>> domain.com/macos/khsdfg.html
>> $myfolder=macos
>>
>> BUT if there is no dir/ in between the domain and file,
>> like so:
>> domain.com/khsdfg.html
>>  then I want:
>> $myfolder=default
>>
>> I am playing with $_SERVER['PATH_TRANSLATED'], ..
>> what function will parse that best?
>> I need to also account for when the URL does not have an in-between
>> dir/, nor a filename in it, e.g.:
>> domain.com/
>> (then again $myfolder=default)
>>
>> TIA!
>> -Govinda
> 
> No way, you want to "parse" the "url"?
> 
> How about, parse_url()?
> 

Oh, and in the future, if you want to "strip" the "slashes" from a var,
you would use the remove_escape_char() function :-)

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:
> Shawn McKenzie wrote:
>> Govinda wrote:
>>> Hi all,
>>>
>>> (PHP newbie here.  Newbie-level task to match.)
>>>
>>> I am RTFM and working on this..  but I am also under deadline, so, I ask
>>> you in case you can point me quick where to read...  what functions I
>>> need to use for this.
>>>
>>> Incoming URL will look like these, for example:
>>>
>>> domain.com/unix/asdfsdf.html
>>> domain.com/macos/khsdfg.html
>>>
>>> I need to parse those URLs and set the value of $myfolder to as follows:
>>>
>>> domain.com/unix/asdfsdf.html
>>> $myfolder=unix
>>> domain.com/macos/khsdfg.html
>>> $myfolder=macos
>>>
>>> BUT if there is no dir/ in between the domain and file,
>>> like so:
>>> domain.com/khsdfg.html
>>>  then I want:
>>> $myfolder=default
>>>
>>> I am playing with $_SERVER['PATH_TRANSLATED'], ..
>>> what function will parse that best?
>>> I need to also account for when the URL does not have an in-between
>>> dir/, nor a filename in it, e.g.:
>>> domain.com/
>>> (then again $myfolder=default)
>>>
>>> TIA!
>>> -Govinda
>> No way, you want to "parse" the "url"?
>>
>> How about, parse_url()?
>>
> 
> Oh, and in the future, if you want to "strip" the "slashes" from a var,
> you would use the remove_escape_char() function :-)
> 

Sorry, after actually reading your post, and having nothing else to do
at the moment (one solution):

$myfolder = basename(dirname($_SERVER['PHP_SELF']));

if(empty($myfolder)) {
        $myfolder = 'default';
}

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
On Thu, 25 Jun 2009 18:20:36 -0500, Shawn McKenzie wrote:

> Shawn McKenzie wrote:
>> Govinda wrote:
>>> I need to parse those URLs and set the value of $myfolder to as follows:
>>>
>>> domain.com/unix/asdfsdf.html
>>> $myfolder=unix
>>> domain.com/macos/khsdfg.html
>>> $myfolder=macos
>>>
>>> BUT if there is no dir/ in between the domain and file,
>>> like so:
>>> domain.com/khsdfg.html
>>>  then I want:
>>> $myfolder=default
>> 
>> No way, you want to "parse" the "url"?
>> 
>> How about, parse_url()?

Or something like:

  /* UNTESTED */
  $myfolder = 'default';
  if (preg_match ('@^[^/]+/([^/]+)/@', $url, $m) {
    $myfolder = $m[1];
  }

or:

  /* UNTESTED */
  $myfolder = 'default';
  $parts = explode ('/', $url);
  if (count ($parts) > 2) {
    $myfolder = $parts[1];
  }

> Oh, and in the future, if you want to "strip" the "slashes" from a var,
> you would use the remove_escape_char() function :-)

Is there a manual page for that?


/Nisse

--- End Message ---
--- Begin Message ---
Hi guys:

Now days I want to develop a web application like a chat room. the requests
per seconds maybe very large, so I want to save some common info into to
memory (quick access).

So, I want to know does php have the follow features or implement them in
other ways.
1. server scope objects, mostly like application in jsp.  // the most
important~
2. multithread synchronize.
3. I want to start a thread timed execute, like Timer in java

thanks
-- 
Best Regards!
Wen Dong

--- End Message ---
--- Begin Message ---
PHP doesn't support threading.

On Thu, Jun 25, 2009 at 10:59 PM, WenDong Zhang<zwd2...@gmail.com> wrote:
> Hi guys:
>
> Now days I want to develop a web application like a chat room. the requests
> per seconds maybe very large, so I want to save some common info into to
> memory (quick access).
>
> So, I want to know does php have the follow features or implement them in
> other ways.
> 1. server scope objects, mostly like application in jsp.  // the most
> important~
> 2. multithread synchronize.
> 3. I want to start a thread timed execute, like Timer in java
>
> thanks
> --
> Best Regards!
> Wen Dong
>

--- End Message ---
--- Begin Message ---
No, it doesn't at this time. Have you looked into Quercus?



> -----Original Message-----
> From: Eddie Drapkin [mailto:oorza...@gmail.com]
> Sent: Thursday, June 25, 2009 11:42 PM
> To: WenDong Zhang
> Cc: php-gene...@lists.php.net
> Subject: Re: [PHP] Does php have multithread, shared object(like jsp
> application)
> 
> PHP doesn't support threading.
> 
> On Thu, Jun 25, 2009 at 10:59 PM, WenDong Zhang<zwd2...@gmail.com>
> wrote:
> > Hi guys:
> >
> > Now days I want to develop a web application like a chat room. the
> requests
> > per seconds maybe very large, so I want to save some common info into
> to
> > memory (quick access).
> >
> > So, I want to know does php have the follow features or implement
> them in
> > other ways.
> > 1. server scope objects, mostly like application in jsp.  // the most
> > important~
> > 2. multithread synchronize.
> > 3. I want to start a thread timed execute, like Timer in java
> >
> > thanks
> > --
> > Best Regards!
> > Wen Dong
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> __________ Information from ESET Smart Security, version of virus
> signature database 4190 (20090626) __________
> 
> The message was checked by ESET Smart Security.
> 
> http://www.eset.com
> 



--- End Message ---
--- Begin Message ---
hello all,
             Is there anyway in php by which i can get the total play
time of a mp3 , I found some information while doing the google thing
using some 3rd party plug ins like getID3 but without any luck, Any help
in this case would be helpful. Thank you.
Regards,

Gautam Bhatia .




--- End Message ---
--- Begin Message ---
Hello fellow coders...

THE 'KING OF POP' IS DEAD !

Tonight (here in Germany), Mr. Michael Joseph Jackson, also known as 'the king of pop',
died on heart failure in the age of 50.

I just want to express my condolences to his family and friends and all the people
who loved him and his music.
This incomparable legendary musician has made such a big impact on music and musicians
than any other artist in history.

Rest in peace, Mr. Jackson! And may you and your music never be forgotten...

YT
BB (a drummer)

PS: I know, this thread usually is of some funny nature, so I opologize for this mood killing
post and I hope you understand


[Björn Bartels                       ]

[email :  bart...@dragon-projects.de ]
[home  :   http://dragon-projects.de ]
[skype :                  bb-drummer ]
[icq   :                   283827160 ]

[----------------------------------- ]

Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

[----------------------------------- ]










--- End Message ---
--- Begin Message ---
Farah Fawcett has also died. I guess you gotta go sometime :|



Björn Bartels wrote:
Hello fellow coders...

THE 'KING OF POP' IS DEAD !

Tonight (here in Germany), Mr. Michael Joseph Jackson, also known as 'the king of pop',
died on heart failure in the age of 50.

I just want to express my condolences to his family and friends and all the people
who loved him and his music.
This incomparable legendary musician has made such a big impact on music and musicians
than any other artist in history.

Rest in peace, Mr. Jackson! And may you and your music never be forgotten...

YT
BB (a drummer)

PS: I know, this thread usually is of some funny nature, so I opologize for this mood killing
post and I hope you understand


[Björn Bartels                       ]

[email :  bart...@dragon-projects.de ]
[home  :   http://dragon-projects.de ]
[skype :                  bb-drummer ]
[icq   :                   283827160 ]

[----------------------------------- ]

Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

[----------------------------------- ]











--
http://www.interjinn.com
Application and Templating Framework for PHP

--- End Message ---
--- Begin Message ---
and Kaleem Omar.

and 15 people in Baghdad when motorcycle loaded with nails and ball-bearings
exploded in a crowded bazaar.



On 6/26/09 4:27 AM, "Robert Cummings" <rob...@interjinn.com> wrote:

> Farah Fawcett has also died. I guess you gotta go sometime :|
> 
> Björn Bartels wrote:
>> Hello fellow coders...
>> 
>> THE 'KING OF POP' IS DEAD !
>> 
>> Tonight (here in Germany), Mr. Michael Joseph Jackson, also known as
>> 'the king of pop',
>> died on heart failure in the age of 50.
>> 
>> I just want to express my condolences to his family and friends and
>> all the people
>> who loved him and his music.
>> This incomparable legendary musician has made such a big impact on
>> music and musicians
>> than any other artist in history.
>> 
>> Rest in peace, Mr. Jackson! And may you and your music never be
>> forgotten...



--- End Message ---
--- Begin Message ---
Hey all, I'm new to the list and I have a question...

What does => mean?

The book I am reading is called Programming PHP published by O'Reilly. I
haven't read the whole book yet. I was flipping through the pages and in
the book there is mention of <= (less than or equal) and >= (greater than
or equal)but it doesn't say what => is even though it is used numerous
times in the example code.

Thanks

Jason




--- End Message ---
--- Begin Message ---
Just getting this back on the list >.>


---------- Forwarded message ----------
From: Eddie Drapkin <oorza...@gmail.com>
Date: Fri, Jun 26, 2009 at 2:36 AM
Subject: Re: [PHP] What does this mean?
To: Jason Carson <ja...@jasoncarson.ca>


It's used in key value combinations in several places.

When building an array:
$foo = array('key' => 'value', 'another_key' => 'another value');
which will give you an array that looks like
$foo['key'] = 'value';
$foo['another_key'] = 'another_value';

Also, in foreach(), which is a language construct used to iterate over arrays:

foreach($foo as $key => $val) {
 echo "The key for this element is $key and the value is $val\n";
}
will output:
The key for this element is key and the value is value
The key for this element is another_key and the value is another_value

Those are the two most common places you'll see it (and perhaps the
only, I don't want to speak conclusively, though, I'm awfully tired
this evening!)

On Fri, Jun 26, 2009 at 2:31 AM, Jason Carson<ja...@jasoncarson.ca> wrote:
> Hey all, I'm new to the list and I have a question...
>
> What does => mean?
>
> The book I am reading is called Programming PHP published by O'Reilly. I
> haven't read the whole book yet. I was flipping through the pages and in
> the book there is mention of <= (less than or equal) and >= (greater than
> or equal)but it doesn't say what => is even though it is used numerous
> times in the example code.
>
> Thanks
>
> Jason
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
-----Original Message-----
From: Tir [mailto:tirsa...@yandex.ru]
Sent: 25 June 2009 08:48 PM
To: php-gene...@lists.php.net
Subject: Re: [PHP] PHP doesn't see php.ini

> Presume you did restart apache after making the change?
Of course

> Is there anything in your phpinfo output that relates to your php.ini?
I think there must be a mention of MySQL because i've enabled it. But it
isn't there.

> Maybe some error near the beginning of php.ini causes php to stop 
> loading the ini file?
I use a copy of php.ini-recommended from PHP distributive. I don't think
that there could be errors. I've only uncommented few strings to enable
MySQL extensions, set display_errors on and changed extension_dir.

> Check that the "extension_dir" in phpinfo agrees with the "extension_dir" 
> in your php.ini.
It agrees.

> Maybe try enabling error logging in the php.ini and check the log file
> - I use apache\logs\phperror.log and invalid extension loading is 
> definitely reported there (I've had this problem before).
That's it, i think. I've enabled display_startup_errors and now on start
apache i receive errors. PHP can't find libraries of MySQL extensions. But
this libraries exactly exist in folder that indicated in error messages. 
What that could be? 

--

Does mysql run from the command line? You can also download MySQL
Administrator from mysql.com and see if it can connect to mysql.

Cheers
Arno


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

on 06/24/2009 09:24 PM Shawn McKenzie said the following:
>> What about placing the contents in different divs and showing hiding
>> those divs on submit? Then using AJAX to update the server / database
>> with the requested operation?
>>
> That's a good one, however I'm assuming you haven't been following PJ's
> posts :-)  Once he tries AJAX, I feel for the js.general and
> ajax.general folks!


Not necesssarily. You may want to try this scaffolding component that
lets you create CRUD (Create, Read, Update, Delete) forms without
writing a single line of Javascript, all with AJAX support, so it
submits the forms to the server without page reloading.

Actually this a plug-in of the Forms Generation and Validation class,
that generates all the necessary Javascript transparently for you. You
can compose any forms with any custom inputs, and save data to databases
or any other type of storage.

Take a look at this live example:

http://www.meta-language.net/forms-examples.html?example=test_scaffolding_input

The main forms class and the optional plug-ins are available from here:

http://www.phpclasses.org/formsgeneration


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

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

--- End Message ---
--- Begin Message ---
On Thursday 25 June 2009 21:38:24 Ashley Sheridan wrote:
> On Wed, 2009-06-24 at 15:23 -0700, salmarayan wrote:
> > Can Anyone tell me how to sort two D Array in Descending Order
> > for example like this one based on the gain
> > Array ( [0] => Array ( [company_name] =>X [gain] => 0.2 ) [1] => Array (
> > [company_name] => y[gain] => 0.34 )[2]1] => Array ( [company_name]
> > =>z[gain] => 2 )  )
> > Thanks in advance
> > --
> > View this message in context:
> > http://www.nabble.com/How-to-sort-a-two-D-ARRAY-tp24193925p24193925.html
> > Sent from the PHP - General mailing list archive at Nabble.com.
>
> stw http://us3.php.net/manual/en/function.array-multisort.php
>
>
>
> Thanks
> Ash
> www.ashleysheridan.co.uk
in this case salmarayan whanted to sotr by one specific feeld of sub array.
        http://us3.php.net/manual/en/function.uasort.php should be used.


-- 
Best regards,
Isia [isj^] (Isataev Vladimir)
ICQ: 305832316
CEL: +38 (067) 58-68-148

--- End Message ---

Reply via email to