php

How to convert yyyy-MM-dd HH:mm:ss to "15th Apr 2010" using PHP

Hi, I have the following date format: 2010-04-15 23:59:59 How would I go about converting this into: 15th Apr 2010 Thanks ...

PHP/SQL/Wordpress: Group a user list by alphabet

I want to create a (fairly big) Wordpress user index with the users categorized alphabetically, like this: A Amy Adam B Bernard Bianca and so on. I've created a custom Wordpress query which works fine for this, except for one problem: It also displays "empty" letters, letters where there aren't any users whose name begins wi...

Get remote image using cURL then resample.

I want to be able to retrieve a remote image from a webserver, resample it, and then serve it up to the browser AND save it to a file. Here is what I have so far: $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "$rURL"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEA...

PHP MYSQLI query error?

Hey This is my login script, using PHP5 and MYSQLi, I just had help spotting errors in my query, but still it will not let me login, even though the username and password are correct and in the database, it just keeps returning the error: your username and password do not match any in our db. But I know they do lol...could any body spot ...

Nested Array with one foreach Loop?

I need to have access to a array which looks like this. Array ( [0] => Array ( [54] => Array ( [test] => 54 [tester] => result ) ) ) foreach($array as $key=>$value) { echo $key;// prints 0 echo $value;// prints Array /* now i can iterate ...

PHP Parse Error Help Needed

I am receiving this PHP parse error on the last line of this php file. What am I missing? Here is the last 15 lines or so. <div id="footer"> <br /> <p><b>Member Total:</b><?php echo $database->getNumMembers(); ?> <br>There are <?php echo $database->num_active_users; ?> registered members and <?php $...

My multipart email script sends HTML messages just fine, but the plain text alternative doesn't not work, what may be wrong?

I have a script set up to send out multipart emails; plain text and html messages. The HTML messages work just fine, but when I used an email client that only does plain text the plaint text message does not render and I get the following: -- This message was generated automatically by Me http://www.somewebsite.com/ $html_msg...

Reliable strtotime() result for different languages

There was always a strange bug in Joomla when adding new article with back-end displayed with a language other than English (for me it's Russian). The field "Finish Publishing" started to be current date instead of "Never" equivalent in Russian. For a site in php4 finally found that strtotime function returns different results for arbi...

Modifying setup file with PHP

I have an application that needs branding when downloaded in certain continents. When installed in North America, for instance, the application, when run, displays a different logo and company name than in Europe. The setup file is provided through a PHP script. Presently there is a Inno Setup executable for Windows and a DMG for Mac OS...

[PHP] Invalid argument supplied for foreach()

It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data. $values = get_values(); foreach ($values as $value){ ... } When you feed a foreach with data that are not an array, you get a warning: Warning: Invalid argument supplied for foreach() in [...] Assuming i...

Simplest possible table entry editing / addition / deletion web toolkit (for use with php)

Hi, i'm building a website in php and i have tables presented that i need to allow the user to: 1. add new entry (only one at a time, which should appear as a new modal overlay) 2. delete multiple selected entries from 3. edit an existing entry (only one at one time, in a view similar to 1.) 4. re-arrange entries up and down. One by one...

Speeding up a soap powered website

Hi all, We're currently looking into doing some performance tweaking on a website which relies heavily on a Soap webservice. But ... our servers are located in Belgium and the webservice we connect to is locate in San Francisco so it's a long distance connection to say the least. Our website is PHP powered, using PHP's built in SoapCli...

Is Doctrine able to detect n-m relations in a db using generateModelsFromDb?

When using generateModelsFromDb to generate the models Doctrine makes one to many relations between the relation table and the base tables instead of generating a nm-relation between the base tables themselves. Is there any way to let generateModelsFromDb detect the n-m relation? ...

Strip Tags and everything in between

How can i strip <h1>including this content</h1> I know you can use strip tags to remove the tags, but i want everything in between gone as well. Any help would be appreciated. ...

Retreiving data from MySQL with html/javaScript on one domain and the PHP file on the other

I need to retrieve data from a MySQL database, and have it work one way for all types of servers. For example it should work on a server that runs no server side language, it should also work on LAMP, and IIS. I was thinking about using ajax and xmlhttprequest, but learned of the cross domain limitation. I also tried to just include the...

Strange php behaviour on a gd function

Hi, i met a very strange PHP behaviour, i don't understand why it behaves like this. I'm using the imagesetbrush function in this way: class foo { function setbrush($image) { //$this->_resource contains the main image resource imagesetbrush($this->_resource, $image); } } ... $res=imagecreatefrompng("image.png"); $...

Is it possible to change the user status on Facebook, using the 'Official PHP Client Library'?

Hi, I downloaded the .php files from here, and I am able to take the first and last name or friend names, but now I want to update the status of a user. I am following the RESTful API documentation, however I can't find a relevant method in the facebookapi_php5_restlib.php file. Am I missing something here, or this is not possible? ...

php - sort the unsorted text file and rewrite to same text file in sorted order

Hi, I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this, Richmond,Virginia Seattle,Washington Los Angeles,California Dallas,Texas Jacksonville,Florida I wrote a code to sort them in order and t...

Is there a pure object database for PHP?

I'm interested in knowing if there is a pure object oriented database for PHP. Something similar to zodb for Python. I'm not really looking for an object-relational mapper. So no active record clones... ...

how to delete duplicates on mysql table?

hello I need to know any way to delete duplicated items for specified sid on table. how can I do this with SQL queries ? DELETE (DUPLICATED TITLES) FROM table WHERE SID = "1" something like this but i don't know true one :/ thanks. ...