Is strcmp() appropriate for comparing ICU collator sort keys in PHP?
The sort keys I'm asking about are from collator_get_sort_key() which are described in ICU documentation.
I'm using PHP 5.2.11. I've seen that 5.3 version has several backward incompatibility issues and because of that some code might require changes.
Since my website is hosted on shared server, many have suggested that those server won't upgrade to 5.3 in near future (probably due to incompatibility issues for many shared users).
Would it be wise to develop a new project in 5.3 which would be hosted on shared server?
I want to create my own RSS/XML feed. I fetch data from the database to display, but keep getting invalid character errors. If the string has an ampersand or other strange characters in it, the XML will be invalid.
I tried using urlencode and htmlentities, but these don't capture all possible characters which need to be escaped. Does anyone know of a PHP function which will prepare a string for XML output?
Hi all,
I need to download an image from some URL to my server. However, my server's config disallowed me to do it this way:
getimagesize( $file );
Because, it generate error:
Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in somefile.php on line 10
So, is there another way I can use that doesn't require external library?
Using PHP, what's the fastest way to convert a string like this: "123" to an integer?
Why is that particular method the fastest? What happens if it gets unexpected input, such as "hello" or an array?
Most of "multi-platform" CI tools I've seen are in the Java/.NET world, like TeamCity or Hudson. Is there a continuous integration tool that can handle both PHP and Rails projects?
How can I encode strings on UTF-16BE format in PHP? For "Demo Message!!!" the encoded string should be '00440065006D006F0020004D00650073007300610067006'. Also, I need to encode Arabic characters to this format.
I have always been confused that .e,g in php i have sql statement
$qry = "select * from table where id = $id";
now can i insert "$" directly inside the quotes or i have to use
$qry = "select * from table where id =".$id." ";
or
$qry = 'select * from table where id = $id';
or
$qry = 'select * from table where id = '$id'';
Which is correct
Hi there just wondering;
How do i deny direct access to files in a specific folder. I have an upload script that uploads to /uploadedFiles and currently i just have an index.php which redirects the user to the login page however how do i stop users from accessing a file directly such as;
www.myurl.com/uploadedFiles/thisFile.jpeg
Thanks in advance :)
Hello,
I have:
$page_file_temp = $_SERVER["PHP_SELF"];
which will output: /templates/somename/index.php
I want to extract from that path only "/templates/somename/"
How can I do it?
Thanks!
I'm looking for a PHP CMS which can let me to:
1-Uploade and manage files ( pdf, words..) between users by allowing to view, to print or to download.
2-Know who accessed what and when, who download what and when... who do what and when.
I have a database online that I would like to be able to load into an NSArray in my app. I can use arrayWithContentsOfURL with a static file, but I really need to go to a url that generates a plist file from the database and loading it into the array. I can use ASP or PHP. I tried setting the response type to "text/xml", but that doesn't help.
Any thoughts?
I can't seem to get the correct Unix epoch time out of this PHP DateTime object.
$startingDateTime = "2005/08/15 1:52:01 am";
$foo = new DateTime($startingDateTime, new DateTimeZone("America/New_York"));
echo $foo-format('U');
which gives
1124085121
Which is Mon, 15 Aug 2005 00:52:01 GMT -500 (according to http://www.epochconverter.com/) but that's incorrect by an hour.
It SHOULD be 1124088721 and spit back at me as Mon, 15 Aug 2005 01:52:01 GMT -500
Any help would be appreciated.
i'm developing an iPhone app which communicates with a remote DB.
for that purpose I'm looking for a web hosting service which inclues the following specs:
latest PHP
cUrl
SSL support
mySql
cron
live support
Max uptime
great money per value ratio
The main functionality is communication with the DB and displaying some info on the app.
It is important that the web hosting provider will be highly reliable.
Are there any providers who give some free usage before starting to pay?
Thanks
I need a regular expression which replaces a string like this
"Myname _MySurename" with "Myname"
that means i just need Myname, so _MySurename should be cut.
i tryed something like "/_*/" but that replaces just the _ (underscore)
how can i do that in PHP ?
Hello,
I want to be able to read any random RSS/ATOM XML file. That would mean I would not not know the tags, start the loop and the fields. How do I go about doing it in PHP.
Thanks
Jean
I have looked over the PHP list of supported timezones, but the whole list is a little long to include in a drop-down menu, for the user to select his or her timezone. Is there a list with the main city/area on that can be used?
My geography is terrible and add that to not knowing all the area and which timezone they fall into it could be a long day to construct the list my self!
Thanks in advance
And from the client side, which request type (GET or POST) is better to use, to send JSON data if I use XmlHTTPRequest?
My application use this stream of data for either retrive data form database and execute some functionality in PHP.
I have two Fedora-based apache webservers making the same SSL PUT/POST calls with php/cURL. One works fine, but with the other the call succeeds but takes a VERY long time to return a response (~10 min). (GETs don't seem affected)
The working server's cURL uses OpenSSL for SSL, while the non-working version uses a later version of cURL that uses NSS for SSL
I know nothing about SSL implementations or their effect on cURL. What would cause such a significant delay in SSL PUT/POST responses?
Any suggestions appreciated- Thanks--
I'm building an iPhone app, which will allow users to log in to a PHP web server that authenticates the user and starts a session.
My idea for managing a session is to create a singleton User class that has a sharedLogin method. Would it be prudent to store the session variable in the shared instance in order to maintain the session?
I need to remove the '&' character from each property of a php object
I tried the code below but it's not working...what am I missing?
thanks dudes
foreach($query_item as $key => $value)
{
$key = str_replace(' & ',' & ',$value);
}
hi
is there any php classes or functions, which will gives us all the days from specific duration? for example, if i want a list of dates from 25/03/2010 (25th march 2010) to 15/05/2010 (15th May 2010), it will give me:
25/03/2010
26/03/2010
26/03/2010
....
....
....
14/05/2010
15/05/2010
thanks a lot for any help!
Consider I have two arrays:
$friends = Array('foo', 'bar', 'alpha');
$attendees = Array('foo', 'bar');
Now I need to populate a new array $nonattendees which contains only the elements which are in $friends array and not in $attendees array. i.e, $nonattendees array should be populated with 'alpha'.
Is there any in built array operation available in PHP to achieve the above functionality or should I write my own for loops?