473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Standard PHP library, PEAR, and templates

Jay
Newbie alert.

Is the standard php library exclusively for PHP5 or is there one for PHP4?
How do I start using it? Is there a require or include directive needed in
order to make use of it?

Same question for PEAR. Is there a PEAR for PHP4 or only for PHP5? How do I
start using its facilities? Is there a require or include directive?

Lastly, I'd like to start using templates. From what I've read, they
simplify code so I don't have to play quoting games like:

echo "foo=\"blah\"" . $foo['bar'] . 'blah' . "bar$foo=\"blah\"";

which is a real drag. I can usually simplify lines like above, but they
never completely simplify to my satisfaction. Googling revealed a bunch of
template libraries. Is there a generally accepted standard one?

I'm using Debian testing/PHP4/Apache/mysql (but thinking of switching to PHP5
and postgresql).

Thanks!
Nov 27 '05 #1
2 1844
There is PEAR for PHP4.
as far as i can remember it is bundled with php. unless you're using
Debian packages, then you need to install php4-pear.
you need to include (or require) the pear module you want to use. Check
the examples on PEAR page.

Now, standard PHP library? All the stuff in the documentation is
bundled in PHP. You only need to include external modules.

about quoting:
echo "$bar"; //displays $bar contents
echo '$bar'; // displays $bar (the string)

you can:
echo "foo=\"blah\"$foo['bar']blahbar$foo=\"blah\"";
even though this string is illegible

Nov 28 '05 #2

Jay wrote:
Newbie alert.

Is the standard php library exclusively for PHP5 or is there one for PHP4?
How do I start using it? Is there a require or include directive needed in
order to make use of it?
I think it is only available in php 5 (not sure though!). And is
included by default in PHP5.

Same question for PEAR. Is there a PEAR for PHP4 or only for PHP5? How do I
start using its facilities? Is there a require or include directive?

Allot of pear libraries are php 4 and 5 compatible. To use a pear lib
like DB you will need to put include('DB.php') in your scripts. Each
library should state if it is compatible with php 4 and 5 and the most
popular ones are compatible with both.
Lastly, I'd like to start using templates. From what I've read, they
simplify code so I don't have to play quoting games like:

echo "foo=\"blah\"" . $foo['bar'] . 'blah' . "bar$foo=\"blah\"";

which is a real drag. I can usually simplify lines like above, but they
never completely simplify to my satisfaction. Googling revealed a bunch of
template libraries. Is there a generally accepted standard one?

I'm using Debian testing/PHP4/Apache/mysql (but thinking of switching to PHP5
and postgresql).

Thanks!


Allot of people have their own preferences. But I would say if there is
a standard one is it smarty.

Nov 28 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bob | last post by:
Hello!!! I am programming a community website, with the usual stuff... some people must subscribe and become members, so they can log in and visit some pages and discuss between them, it's a...
2
by: juglesh | last post by:
howdy, I am using this code library thing: http://sourceforge.net/projects/php-csl/ http://www.php-csl.com/snippets/ and had an idea. I was thinking about keeping a bunch of functions in the...
71
by: Christopher Benson-Manica | last post by:
At what point was the .h dropped from the STL headers? I just had a discussion yesterday with my boss, who said he wanted .h on all the STL includes, despite me protesting that it was not...
6
by: ik | last post by:
Hello All, Can somebody tell, which compiler conforms C++ Standard, regarding templates better on Win32 Platform ? I was finding problems with VC++6.0 with some template code, but the same works...
43
by: Steven T. Hatton | last post by:
Now that I have a better grasp of the scope and capabilities of the C++ Standard Library, I understand that products such as Qt actually provide much of the same functionality through their own...
1
by: James | last post by:
Hey everyone, I have a really obscure but impassable problem with a reasonably simple piece of php/PEAR DB/MySQL code When calling several stored procs the first call succeeds, but subsequent...
8
by: Metaosp | last post by:
Is there any good on-line reference manual for the latest standard c++ library? In the Java world the library documents are so readily available that makes coding a lot easier, I really wish to...
0
by: Howard | last post by:
I installed pear or was trying to. I ran the pear_env.reg script to load pear in registry in order to have it in my path. But typing pear at the command line does not work. Pear is not...
16
by: subramanian100in | last post by:
Program 1: --------------- #include <cstdlib> #include <iostream> #include <vector> using namespace std; int main() {
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.