[PHP] an easy (perhaps dumb) question about PHP

2004-06-07 Thread Cere Davis
I haven't been able to glean anything about this from the Oreilly books, 
php web site, or anywhere else so I am breaking down and asking on this 
list.

In other scripting languages like Perl/Ruby/Python (that aren't meant to 
live in the web environment exclusively) there usually have a web 
library that writes basic html form input html types for like 
radio_button(name,val) and checkbox(name,val) type functions.  I can't 
see that php has this type of feature.  Perhaps this is deliberate as 
not having something preset affords more flexability in a way, I just 
want to be sure I am not missing something...  does this kind of thing 
exist in PHP?  Thanks.

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


[PHP] stdClass to array

2005-01-11 Thread Cere Davis

Hey folks,

Does anyone know of a painless way to convert a stdClass object to an
associative array in php?

Also, I wonder, is there a way to "flatten" associative arrays in php?
So say:  
$b=new array(s=>"S")
$a=new array(a=>"A",b=>$b) 

goes to:
 $z=flatten($a);
z turns to:
 (a=>"A", b=>$b, s=>"S");

Thanks,
Cere

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



[PHP] calling php functions as library or cmd line

2005-01-13 Thread Cere Davis
Does anyone know how to write php  libraries in a modular way so that you
can both test the libraries/functions on the command line with arguments
and/or use the php library as a part of your web code with 'require_once()'
syntax?  Sort of like how Python or Ruby works?

Thanks,
Cere

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



[PHP] Re: calling php functions as library or cmd line

2005-01-14 Thread Cere Davis

Geeze,

That was obnoxious.

Luckily google helped me out eventually:
if (basename($argv[0]) == basename(__FILE__)) {


Robert Cummings wrote:

> On Thu, 2005-01-13 at 09:46, Cere Davis wrote:
>> Does anyone know how to write php  libraries in a modular way so that you
>> can both test the libraries/functions on the command line with arguments
>> and/or use the php library as a part of your web code with
>> 'require_once()'
>> syntax?  Sort of like how Python or Ruby works?
> 
> Yes.
> 
> Cheers,
> Rob.

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



[PHP] phpinfo() doesn't report correctly for php 5.0.3

2005-01-24 Thread Cere Davis
Has anyone else noticed this?

When I install php5.0.3 with:

make clean &&

./configure  --prefix=/usr/local --with-mysqli=shared,/usr/bin/mysql_config
--enable-soap  --enable-cli --with-pear --with-apxs2=/usr/bin/apxs2
--enable-xmlrpc --no-create --no-recursion --with-soap --with-xmlrpc
--with-xslt --with-xml2 --with-jpeg --with-png --with-gd --with-zlib
--with-tiff --with-readline --enable-sockets --enable-shared-pdflib
--enable-force-cgi-redirect --with-gettext --enable-mailparse --with-curl
--enable-exif --with-fastcgi --enable-discard-path --with-versioning
--with-layout=GNU  

&& make install

phpinfo() reports that it was built by ./configure with no switches (as
shown below).  

PHP Version => 5.0.3

System => Linux ubu 2.6.8-1-686 #1 Thu Nov 25 04:34:30 UTC 2004 i686
Build Date => Jan 23 2005 20:05:22
Configure Command =>  './configure'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
PHP API => 20031224
PHP Extension => 20041030
Zend Extension => 220040412
Debug Build => no
Thread Safety => disabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp
Registered Stream Socket Transports => tcp, udp, unix, udg


Has anyone else had this problem?
Any advice?

Thanks,
-Cere

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