Can you create websites with Chinese characters in PHP?
UPDATE: Perhaps I should have said - is it straight forward. Because some languages like Java make it extremely easy. Perhaps localisation in PHP isn't as easy as Java???
...
I'd like to capture the output of var_dump to a string.
The PHP docs say
As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example).
Can someone give me an example of how that might work?
print_r() isn't a...
I have normally hand written xml like this:
<tag><?= $value ?></tag>
Having found tools such as simpleXML, should I be using those instead? What's the advantage of doing it using a tool like that?
...
if I call php's parse_ini_file("foo.ini"), in what paths does it look for foo.ini ?
the include path? the function's documentation doesn't mention it.
...
Let's say we have index.php and it is stored in '/home/user/public/www' and index.php calls the class Foo->bar() from the file 'inc/app/Foo.class.php'. I'd like the bar function in the Foo class to get a hold of the path '/home/user/public/www' in this instance - and I don't want to use a global variable, pass a variable etc.
...
It often happens that characters such as é gets transformed to é, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the Content-Type for the page is also set to UTF8.
I know about utf8_encode/decode, but I'm not quite sure about where and how to use it.
I have read the "The Absolute...
What would be the best practice way to handle the caching of images using PHP.
The filename is currently stored in a MySQL database which is renamed to a GUID on upload, along with the original filename and alt tag.
When the image is put into the HTML pages it is done so using a url such as '/images/get/200x200/{guid}.jpg which is rewr...
Hi all,
Is it possible to find the foreach index?
in a "for" loop as follows:
for($i = 0; $i < 10; ++$i){
echo $i.' ';
}
$i will give you the index.
Do I have to use the for loop or is there some way to get the index in the foreach loop?
...
Is there a way to check to see if a date/time is valid you would think these would be easy to check:
$date = '0000-00-00';
$time = '00:00:00';
$dateTime = $date . ' ' . $time;
if(strtotime($dateTime)) {
// why is this valid?
}
what really gets me is this:
echo date('Y-m-d', strtotime($date));
results in: "1999-11-30",
huh? i ...
We currently use a hand-rolled setup and configuration script and a hand-rolled continuous integration script to build and deploy our application. I am looking at formalizing this somewhat with a third party system designed for these purposes.
I have looked into Phing before, and I get that it's basically like Ant. But, my Ant experienc...
I personally use var_dump, but lots of people like print_r.
What does everyone use? Pros and Cons?
Does someone have a special home brew function of their own?
...
I'm parsing XML results from an API call using PHP and xpath.
$dom = new DOMDocument();
$dom->loadXML($response->getBody());
$xpath = new DOMXPath($dom);
$xpath->registerNamespace("a", "http://www.example.com");
$hrefs = $xpath->query('//a:Books/text()', $dom);
for ($i = 0; $i < $hrefs->length; $i++) {
$arrBookTitle[$i]...
I currently use CodeIgniter for an MVC framework in PHP because it's a very bare framework, is there anything even more bare than CodeIgniter?
...
I've been coding in PHP for almost ten years, but I've lately become interested in Python. What Python book would you recommend?
...
Is it possible to use PHP's SimpleXML functions to create an XML object from scratch? Looking through the function list, there's ways to import an existing XML string into an object that you can then manipulate, but if I just want to generate an XML object programmatically from scratch, what's the best way to do that?
I figured out tha...
I am trying to write a cronjob controller, so I can call one website and have all modules cronjob.php executed. Now my problem is how do I do that?
Would curl be an option, so I also can count the errors and successes?
[Update]
I guess I have not explained it enough.
What I want to do is have one file which I can call like from http...
As a way to find inspiration and improve my PHP skills, I am looking for some beautiful PHP source code to read, preferably an open source "standard" web site rather than a more tool-like project such as phpMyAdmin.
So, where can I find some beautiful PHP code?
...
I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards.
I would love to hear your suggestions and which one is the best and why.
I will be running it on a debian server so anything which runs on mac or windows servers would be out of the question.
...
I am writing an application that thus far has been written in PHP, from the interface to the daemons. I have a need to use fuse and would like to continue to use PHP just for consistency. However, there doesn't seem to be bindings for PHP. Python, Java etc have bindings, and I can code in those languages I just dont want the additional d...
I am in the process of designing a Web Services course for students in an Information Technology program. Some students stop after getting a two-year associates degree, but other students in the program go on to a four-year bachelor's degree. This course would be for students going on to the four-year degree.
My initial thoughts for t...