php-general Digest 22 May 2010 18:22:11 -0000 Issue 6758
Topics (messages 305418 through 305423):
Re: Please guide in selection of Framework: according to your experience
305418 by: Vishal Rewari
Re: Using if(isset()) with $_GET and switch and default
305419 by: MuFei
Re: Remove blank lines from a file
305420 by: tedd
305422 by: Robert Cummings
Re: localize string (date)
305421 by: tedd
305423 by: Phpster
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hello All,
thank you for your guidance, I have successfully completed my project
I used Andre Polykanine`s advice, as I was a starter in PHP. No frameworks,
used pure PHP but yes kept them under different directories based on their
context.
The project is looking good and I am excited
Thank you once again. Hope you guys continue to help new comers like us.
On Tue, Mar 30, 2010 at 7:42 AM, Jochem Maas <[email protected]> wrote:
> Op 3/27/10 4:28 AM, Vishal Rewari schreef:
> > Dear PHP community,
> >
> > I am vishal, I have recently started development in PHP
> >
> > I have come across these PHP frameworks:
> >
> >
> > 1. Codeigniter
> > 2. Symphony
> > 3. CakePHP
>
> those are frameworks.
>
> > 4. PEAR
>
> this is a library. there is a difference ... it's get a bit confusing,
> especially
> when you consider ZendFramework ... which I'd consider to be more of a
> library.
>
> My preference goes towards using frameworks for complex backend apps that
> have a
> limited, controlled audience (i.e. the employees of the client) ... this
> allows
> you to concentrate on 'complex' CRUD functionality and business logic
> without having
> to invest lots of time into the bell and whistles that give a CMS/CRM/app
> the 'wow'
> factor (a decent framework should give you a lot for 'free')
>
> When it comes to building front/public facing apps/sites I tend to go down
> the
> roll-your-own road - this allows for absolute control, flexibility and (if
> you do things right)
> much more performance, when rolling-your-own it's important to still
> leverage specialist libs/classes
> where feasable in order to avoid re-invent every single wheel you come
> accross (reCaptcha, dompdf, phpmailer
> are some examples of code that are worth using). (as a caveat, small sites
> with 'modest' requirements can often
> benefit from just using an existing app, e.g. WordPress, combined with some
> custom templating and/or
> functionality.)
>
> ... but that is all moot, first dig into the language and code some stuff
> from scratch and get a
> good understanding of the fundamentals - frameworks and complex libraries
> will just confuse
> the matter and make learning the basics more painful.
>
> >
> >
> >
> > Please guide me which one of them is *good in performance ? available
> > functionality ? Easy to use and configure* or the one you would recommend
> > according to your experience.
> >
> >
> > My DB is MySQl, or should I stick to native call from PHP?
> >
>
>
--
--
Warm Regards
Vishal Rewari
Student - LD College of Engineering,
AIESEC - Ahmedabad.
---------------------------------------------------
AIESEC - [email protected]
Gmail - [email protected]
Skype - vishal.rewari
Mobile - +919428104319
Website : http://rewarivishal.blogspot.com/
-----------------------------------------------------------
19
--- End Message ---
--- Begin Message ---
Yes, I got it now.
Thanks Daniel
Thanks everyone!
On Sat, May 22, 2010 at 12:08 AM, Daniel P. Brown
<[email protected]> wrote:
> On Fri, May 21, 2010 at 17:02, MuFei <[email protected]> wrote:
>> Hi Ashley,
>> Your way works also great, But I have some question thought:
>> When I only use the first half of the code you suggested:
>> $question = (isset($_GET['question']));
>> then use the $question in the switch it works as I want it.
>> If I use the whole code( $question =
>> (isset($_GET['question']))?$_GET['question']:'some default value
>> here';), the results also are the same.
>> My question is:
>> What is the code from the "?"sign to the end for?
>
> Ash gave you a ternary operator example.
>
> http://php.net/manual/en/language.operators.comparison.php
>
> --
> </Daniel P. Brown>
> [email protected] || [email protected]
> http://www.parasane.net/ || http://www.pilotpig.net/
> We now offer SAME-DAY SETUP on a new line of servers!
>
--- End Message ---
--- Begin Message ---
At 4:27 PM +0200 5/21/10, Anton Heuschen wrote:
So in the file it would look like (from the original file the user uploads
that is)
1
2
3
4
5
6
but when the file is saved to the server it must look like
1
2
3
4
5
6
If that is all (i.e., removing double linefeeds), then this will do it:
$text_array = array();
$text_array = explode("\n\n", $input_text);
$output_text = implode("\n",$text_array);
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
tedd wrote:
At 4:27 PM +0200 5/21/10, Anton Heuschen wrote:
So in the file it would look like (from the original file the user uploads
that is)
1
2
3
4
5
6
but when the file is saved to the server it must look like
1
2
3
4
5
6
If that is all (i.e., removing double linefeeds), then this will do it:
$text_array = array();
$text_array = explode("\n\n", $input_text);
$output_text = implode("\n",$text_array);
Sorry tedd, this is broken. It doesn't solve problems with runs of
greater than 2 newlines which is even in the example :) I would use the
following instead which is also line break agnostic with final output in
the style for your system:
<?php
$data = preg_replace( "#[\r\n]+#", PHP_EOL, $input );
?>
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
At 8:00 PM +0100 5/21/10, Ashley Sheridan wrote:
What sort of format is that date, English or American?
For example: dd-mm-yyyy or mm-dd-yyyy?
Thanks,
Ash
Ash:
I don't think it's called "English" or "American" -- as Churchill
once said "We are separated by a common language." Perhaps "British
English" vs "American English", but I don't think that is correct
either.
While America typically uses mm-dd-yyyy the *majority* of the rest of
the world uses dd-mm-yyyy -- which I think is far more logical.
However, there are regions who commonly use yyyy-mm-dd (i.e., China,
Japan), which is also logical.
It seems that America is the only region who mixes the
most-significant-digit order (big, little, and middle endians). I
don't understand why it came about, perhaps it was one of those
American Almanac articles like the one that claimed using double
negatives was poor grammar which caused a significant changer in the
language.
In any event, in all cases where it's my choice, I use the dd-mm-yyyy format.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On May 22, 2010, at 12:07 PM, tedd <[email protected]> wrote:
At 8:00 PM +0100 5/21/10, Ashley Sheridan wrote:
What sort of format is that date, English or American?
For example: dd-mm-yyyy or mm-dd-yyyy?
Thanks,
Ash
Ash:
I don't think it's called "English" or "American" -- as Churchill
once said "We are separated by a common language." Perhaps "British
English" vs "American English", but I don't think that is correct
either.
While America typically uses mm-dd-yyyy the *majority* of the rest
of the world uses dd-mm-yyyy -- which I think is far more logical.
However, there are regions who commonly use yyyy-mm-dd (i.e., China,
Japan), which is also logical.
It seems that America is the only region who mixes the most-
significant-digit order (big, little, and middle endians). I don't
understand why it came about, perhaps it was one of those American
Almanac articles like the one that claimed using double negatives
was poor grammar which caused a significant changer in the language.
In any event, in all cases where it's my choice, I use the dd-mm-
yyyy format.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I blame Microsoft!
Personally I prefer to use yyyy-mm-dd since that is the format for
many DBs
Bastien
Sent from my iPod
--- End Message ---