Example: if I want to upload a video to some video service website (such as Youtube) by email, I can send a video to an email address (e.g 1234567890@upload.youtube.com). The number is an upload code – It’s a unique number and changes every time. Then Youtube will process and upload my video autom…
Tag: php
UTF 8 and Windows 1254 charset mismatch
I’m using Drupal 7. And i created a block and embed this code: My site charset: And external link charset is: So, when get some info on external link, i have character problem (don’t seen İ, ç, ş etc..) How can i solve this? Answer In your block, I would create these two lines: so this page’…
How to force Doctrine to update array type fields?
I have a Doctrine entity with array type field: /** * @ORMTable() */ class MyEntity { (…) /** * @var array $items * * @ORMColumn( type=”array” ) */ private $…
Failure to connect to mySQL DB via PHP (msqli object-oriented issue)
I’m trying to connect from my Heroku app to a mysql db (Xeround) in an object-oriented way: $this->db = new mysqli( Credentials::databaseHost(), Credentials::databaseUsername(), …
fputcsv display leading zeros
I’m using a PHP script to generate an excel CSV file from a result-set query. All works fine but when I read my excel file, I can not display leading zeros. This is my code: If I make a var_dump() of $finalData[] I see the correct value, for example ‘000198’, ‘000199’, ‘000…
PHP cURL vs file_get_contents
How do these two pieces of code differ when accessing a REST API? and They both produce the same result, judging by Answer file_get_contents() is a simple screwdriver. Great for simple GET requests where the header, HTTP request method, timeout, cookiejar, redirects, and other important things do not matter. …
MySQL: Group by two columns and sum
Building an inventory system. I have lots of products and each product has three different variables. So for stock totals I want to group by the two columns (product & size) and sum quantity to …
PHP checkdate variants
I found a php function checkdate() , but strangely enough it only seems to accept data in format of int $month , int $day , int $year. However I am passing the date as a string (example “2012-06-13”) …
Get most recent date from an array of dates in “Y-m-d H:i:s” format
I have the array of dates in Y-m-d H:i:s format like: I would like to know the most recent date. In other words, today is June 13th 2012, which datetime is closest to today’s date? From my sample array, I am expecting 2012-06-11 08:30:49. How can I do that? Answer Do a loop, convert the values to date, …
Create an XML file in server using SimpleXML and jQuery Ajax
What I want to do surely can be accomplished but I’m doing something wrong: I want to create an XML file when I use an Ajax call. I got the following code (synthesized). Maybe this example doesn’t work, it’s just to exemplify: HTML PHP in server In this example the PHP code works as is, the …