Re: Re: [PHP] Round with money_format

2011-09-19 Thread Cyril Lopez
2011/9/17 Bill Guion :
> On Sep 17, 2011, at 3:46 AM, Cyril Lopez wrote:
>
>> From: Cyril Lopez 
>> Date: September 16, 2011 10:58:28 AM EDT
>> To: php-general@lists.php.net
>> Subject: Round with money_format
>>
>> Hi,
>>
>> Can someone help me understand how money_format() rounds numbers ?
>>
>> > setlocale(LC_ALL, 'fr_FR.UTF-8');
>> $price = 12.665;
>> echo money_format('%i',$price);
>> // 12.66 EUR, 12.67 EUR expected
>>
>> $price2 = 12.666;
>> echo money_format('%i',$price2);
>> // 12.67 EUR, ok
>>
>> echo round($price,2);
>> // 12.67, ok
>> echo round($price2,2);
>> // 12.67, ok
>> ?>
>>
>> Misconfiguration ? Bug ?
>> Thanks !
>>
>> Cyril
>>
>> Config :
>> Debian Lenny, PHP 5.3.8
>
> As someone else pointed out, rounding rules vary by locale, but I was taught 
> 40+ years ago in graduate school programming class, 4 rounds down, 6 rounds 
> up, and 5 rounds to the even number. This means 65 rounds to 6, while 75 
> rounds to 8. Your example seems to follow that rule.

Mmh ok. In french we call us "banking round" but the "infinite round"
(PHP_ROUND_HALF_UP) is more usual ?
Thanks all. But... Last question, what kind of round do you use for
pricing information, shop, bank requests ?

Cyril

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



Re: [PHP] Installing extensions

2011-09-19 Thread Daniel Brown
On Sun, Sep 18, 2011 at 15:21, tamouse mailing lists
 wrote:
> I'm having a bit of trouble installing PHP extensions.
>
> I have the following in php.ini:
>
>  extension_dir =
> ".:/usr/local/lib/php/extensions:/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
>
> In /usr/local/lib/php/extensions/no-debug-non-zts-20090626, i have the
> following:
>
>  -rwxr-xr-x  1 root  wheel   25652 Sep 18 13:04 geoip.so*
>  -rwxr-xr-x  1 root  wheel  115536 Jul 13 16:55 iconv.a*
>  -rwxr-xr-x  1 root  wheel   40556 Jul 13 16:55 iconv.so*
>
> but if I do php -i | grep -E '(iconv|geoip)' , i get nothing.
>
> So apparently the extensions aren't being added as I thought.
>
> System info:
>  Mac OSX 10.5.8
>  php 5.3.6
>
> Any clues will be greatly appreciated!

You have to add the extensions to your php.ini file, and - if
using them on the web - remember to restart Apache.

-- 

Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] Search for string followed by whitespace

2011-09-19 Thread Daniel Brown
On Sun, Sep 18, 2011 at 15:12, Tim Streater  wrote:
> At the moment, I'm doing this:
>
>   $start = stripos ($body, "
> You'll note the space after the ' for ' $loc'th character, and returning the location of the string in $start.
>
> I had a look at the PCRE and POSIX regexp functions to no avail. Is there a 
> slick way of doing this with one function call or should I just search for 
> '
> Thanks,

Try something along this line:



Replace $text with the text through which you want to look, and
your results will be an array in $matches.  The \b switch in the
regexp will match any word/letter border, which includes whitespaces,
tabs, newlines, periods, et cetera.  Essentially, anything that you'll
want to match inside HTML tags, be they valid or otherwise.  The U
modifier makes the search "Ungreedy," while the i modifier makes it
case-iNsEnSiTiVe.

-- 

Network Infrastructure Manager
http://www.php.net/

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



[PHP] PHP installations, usage, and popularity

2011-09-19 Thread Tedd Sperling
Hi gang:

I need information to convince administrators in "management" that PHP is a 
viable subject that should be taught in college with credits going toward a 
Degree or Certification.

You see, I am pushing for a Web Development Certification program that would 
include PHP/MySQL as well as several other Web Languages (i.e., html, css, 
javascript, ajax).

Currently the college teaches ASP in a regular course toward a IT 
Certification, but class attendance has dropped considerably -- no one wants to 
take the course.

However, My PHP class has been maxed out. But my class is a "special topic" 
class and not part of the regular coursework that would go towards a Degree or 
Certification -- and that's where I would like this to go.

As such, I need information regarding how wide-spread PHP is (i.e., number of 
installations), who's using it (i.e., companies, organizations), and how it 
compares with other Web Languages (i.e., ASP, Ruby, etc.).

So, what say you? References will work.

Thanks,

tedd

_
t...@sperling.com
http://sperling.com






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



Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Bastien Koert
On Mon, Sep 19, 2011 at 5:08 PM, Tedd Sperling  wrote:
> Hi gang:
>
> I need information to convince administrators in "management" that PHP is a 
> viable subject that should be taught in college with credits going toward a 
> Degree or Certification.
>
> You see, I am pushing for a Web Development Certification program that would 
> include PHP/MySQL as well as several other Web Languages (i.e., html, css, 
> javascript, ajax).
>
> Currently the college teaches ASP in a regular course toward a IT 
> Certification, but class attendance has dropped considerably -- no one wants 
> to take the course.
>
> However, My PHP class has been maxed out. But my class is a "special topic" 
> class and not part of the regular coursework that would go towards a Degree 
> or Certification -- and that's where I would like this to go.
>
> As such, I need information regarding how wide-spread PHP is (i.e., number of 
> installations), who's using it (i.e., companies, organizations), and how it 
> compares with other Web Languages (i.e., ASP, Ruby, etc.).
>
> So, what say you? References will work.
>
> Thanks,
>
> tedd
>
> _
> t...@sperling.com
> http://sperling.com
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Ask them if they've heard of

facebook
oracle uses php in the web based admin tool
ibm has a close association with zend and php
microsoft is supporting php natively in win2008 server

Usage stats

http://php.net/usage.php



-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Daniel P. Brown
On Mon, Sep 19, 2011 at 17:08, Tedd Sperling  wrote:
>
> As such, I need information regarding how wide-spread PHP is (i.e., number of 
> installations), who's using it (i.e., companies, organizations), and how it 
> compares with other Web Languages (i.e., ASP, Ruby, etc.).

There's no really good metric in recent history (since about
Netcraft's 2007 survey, I guess) that shows PHP's installation figures
--- not even a general representation.  Back in early 2009 (as in,
almost three years ago), I used Google's 'filetype' filter to get an
approximation and posted the results on this list and on one of my
sites[1].  I'm working on finishing a new version of my own software
which will sample millions of domains and query them to see if they
report having PHP installed as well, but I don't expect those results
to be available for some time to come.  I have, however, been thinking
of making it a real-time counter, which would then show the stats as
things run.

As for who's using it, that's a question with an unending answer.
Facebook was built in PHP, which is perhaps the most glaring argument
by itself, and one to which most folks can instantly relate, as
they're more likely to be a user than not, according to Facebook's
market saturation statistics.  Other sites and companies include
Yahoo!, Google, NBC, Verizon, and - as you know - LCC-MAHE.  On top of
that, what most folks may not realize, is that the White House website
(http://www.whitehouse.gov/) uses Drupal, which is also written in
PHP.  In fact, a fun fact for now is that regular freelance developers
aren't the only ones who drop the ball sometimes and let error
messages display on the web.  So does the White House[2].

Other US government body websites that have used and/or continue
to use PHP include the US Congress, the Library of Congress, the
National Oceanic and Atmospheric Administration (NOAA), the National
Aeronautics and Space Administration (NASA), the Department of Justice
(DOJ), most state government websites, and all five branches of the
armed services.

^1: http://links.parasane.net/nc8d
^2: http://links.parasane.net/zdzu

-- 

Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread David Harkness
Gently remind them that the P in LAMP stands for PHP. There's a big reason
most every web developer can tell you what each letter in LAMP stands for:
heavy market penetration.

Peace,
David


Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Daniel Brown
On Mon, Sep 19, 2011 at 18:10, David Harkness  wrote:
> Gently remind them that the P in LAMP stands for PHP. There's a big reason
> most every web developer can tell you what each letter in LAMP stands for:
> heavy market penetration.

It has become a presumption in that regard, yes, but the 'P' in
LAMP was actually for Perl.

-- 

Network Infrastructure Manager
http://www.php.net/

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



[PHP] While on the topic of PHP Web Site Stats - SharePoint...

2011-09-19 Thread George Langley
Hi all. Had a meeting today where I was rather condescendingly told 
that most CMS web sites use SharePoint. Last I checked:



Wordpress, Joomla! and Drupal (PHP, PHP and oh look, PHP) kind of had the CMS 
market wrapped up, with numerous other systems fighting for the remains. In 
fact, I don't see SharePoint even listed at the above link.

Any stats on (warning - buzzwords ahead) "External-facing" web sites 
using SharePoint?

At $$$ for the required server software, compared to <$ for just about 
anything PHP-based, can only imagine companies using SharePoint must have their 
IT department in charge of the web site. Am sure it's fine as an internal 
project management tool, but am very concerned when other developers tell me to 
run away from anyone who chooses to use SharePoint on anything public.
Thanks.


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



Re: [PHP] While on the topic of PHP Web Site Stats - SharePoint...

2011-09-19 Thread Daniel Brown
On Mon, Sep 19, 2011 at 18:22, George Langley  wrote:
>        Hi all. Had a meeting today where I was rather condescendingly told 
> that most CMS web sites use SharePoint.

Well, you may reply, equally condescendingly, that you will need
that to have cited references, as it's simply incorrect.  According to
the latest survey conducted by w3techs.com[1], though SharePoint is
used on sites with some of the highest traffic on the Internet, its
saturation point is just 0.3%.

According to the survey, the five CMS platforms ahead of it in
popularity, in order, are (and quite expectedly): WordPress, Joomla!,
Drupal, vBulletin, and Blogger.  And of those five, one is a service
(blogger.com), and the rest are all open-source CMS systems ---
written in PHP.

-- 

Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Gregor Mitzka
As far as I know it is called LAMPP and not LAMP. So you have PHP and also
Perl. But never the less PHP is one of the most widespread web languages
now-a-days.

2011/9/20 Daniel Brown 

> On Mon, Sep 19, 2011 at 18:10, David Harkness 
> wrote:
> > Gently remind them that the P in LAMP stands for PHP. There's a big
> reason
> > most every web developer can tell you what each letter in LAMP stands
> for:
> > heavy market penetration.
>
> It has become a presumption in that regard, yes, but the 'P' in
> LAMP was actually for Perl.
>
> --
> 
> Network Infrastructure Manager
> http://www.php.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Jason Pruim


Sent from my iPhone

On Sep 19, 2011, at 5:08 PM, Tedd Sperling  wrote:

> Hi gang:
> 
> I need information to convince administrators in "management" that PHP is a 
> viable subject that should be taught in college with credits going toward a 
> Degree or Certification.

Would another college already doing that help or hurt? Full sail university 
does just that both online and in person if you're local. 

Almost took the program but ran out of money to quickly... They aren't cheap 
but they are good!

> 
> You see, I am pushing for a Web Development Certification program that would 
> include PHP/MySQL as well as several other Web Languages (i.e., html, css, 
> javascript, ajax).
> 
> Currently the college teaches ASP in a regular course toward a IT 
> Certification, but class attendance has dropped considerably -- no one wants 
> to take the course.
> 
> However, My PHP class has been maxed out. But my class is a "special topic" 
> class and not part of the regular coursework that would go towards a Degree 
> or Certification -- and that's where I would like this to go.
> 
> As such, I need information regarding how wide-spread PHP is (i.e., number of 
> installations), who's using it (i.e., companies, organizations), and how it 
> compares with other Web Languages (i.e., ASP, Ruby, etc.).
> 
> So, what say you? References will work.
> 
> Thanks,
> 
> tedd
> 
> _
> t...@sperling.com
> http://sperling.com
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread David Harkness
On Mon, Sep 19, 2011 at 3:22 PM, Daniel Brown  wrote:

> On Mon, Sep 19, 2011 at 18:10, David Harkness 
> wrote:
> > Gently remind them that the P in LAMP stands for PHP.
>
> It has become a presumption in that regard, yes, but the 'P' in
> LAMP was actually for Perl.
>

LOL! That I totally forgot it used to stand for Perl pretty much proves my
point. That or focusing on any language for a few years will tend to make
one fairly myopic. :)

Peace,
David


Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Daniel Brown
On Mon, Sep 19, 2011 at 20:17, David Harkness  wrote:
>
> LOL! That I totally forgot it used to stand for Perl pretty much proves my
> point. That or focusing on any language for a few years will tend to make
> one fairly myopic. :)

I waited for someone to chime in about Python being included in
that list as well (in many circles, the 'P' in LAMP is ambiguous for
the three: Perl, Python, and PHP).

-- 

Network Infrastructure Manager
http://www.php.net/

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



[PHP] Re: While on the topic of PHP Web Site Stats - SharePoint...

2011-09-19 Thread Ross McKay
On Mon, 19 Sep 2011 16:22:59 -0600, George Langley wrote:

>[...]
>   Any stats on (warning - buzzwords ahead) "External-facing" web 
>sites using SharePoint? [...]

Try here:

http://w3techs.com/technologies/overview/content_management/all

(SharePoint comes in at 0.1% of all websites, 0.3% of all CMS; i.e.
wy behind the PHP-based CMS out there -- e.g. WordPress on 14.9%
websites and 54.4% CMS)
-- 
Ross McKay, Toronto NSW Australia
"All we are saying
 Is give peas a chance" - SeedSavers

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



Re: [PHP] Re: While on the topic of PHP Web Site Stats - SharePoint...

2011-09-19 Thread Tommy Pham
I don't know about external facing and 'most web sites use SharePoint' but
SharePoint is mainly used in conjunction with other midsize/enterprise MS
applications such as Exchange, SQLServer and other MS products, including
SSO integration with Active Directory.  I've yet to see it used as
standalone with only MS SQLServer.  If you want to use a CMS without having
the need to use any other enterprise, or midsize, MS apps, it's expensive to
deploy as you'll need to deploy on Windows.  On top of that, the recent
version Foundation 2010 is a PAIN IN THE *SS to deploy and maintain with any
SQL Express version.  Don't even think about developing it further on the
Foundation 2010.  Buying MS SQLServer just for the sake of SharePoint only
is not worthwhile as that cost is even higher.  Furthermore, SharePoint
2010, even the free version Foundation, is very hardware demanding.  Simply
put, if your company currently using any MS products, Exchange, SQLServer,
etc. and is midsize+, then it maybe justifiable to use SharePoint, not just
the free version.  Else, if you just need a CMS that's the lowest TCO and
easier to maintain, stick w/ PHP and Open Source, IMO.

Regards,
Tommy


Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Tommy Pham
ASP? Not ASP.NET? Wow... I haven't any new sites deployed in ASP in almost
10 years.  IIRC, ASP is nothing more but bunch of spaghetti codes and no
OOP.  That's why attendance/registration is so low.  Only main web (server
side) development languages are ASP.NET (C#), Java, and PHP (listed as
alphabetical order - not based on demand/popularity).  You'd probably say
Perl and/or Python too.  IMO, best way to convince the administration is job
search for "ASP under IT category" and show them the results vs search for
PHP ;)  No need for long explanations and comparisons since the point of
having students certified is that they could get a job quickly.

Best wishes,
Tommy