I was looking to see if it's possible to set multiple variables with one ternary operator. I google'd a bit, but didn't come up with anything. I started testing a few ideas, and found something close -- but also getting some strange behavior; any ideas as to what's going on? And, is it possible to set more than one var in a single ternar...
Hi Folks,
I need to send a base64 encoded string to a client. Therefore, I'm opening and reading an image file on the server, encode it and send that data along with the image/jpeg content-type to the browser.
Example in php:
$image = $imagedir . 'example.jpg';
$image_file = fopen($image, 'r');
$image_data = fread($image_file, fi...
Is there anything out there in the PHP world with equivalent functionality to SORL thumbnail (a Django project).
Specifically:
1) It caches results (generating thumbnails on the fly is too cpu intensive).
2) It provides a smart cropping feature that crops to fit based on image entropy (so it doesn't just crop to center, but rather crops...
Hello,
Our company now has over 40 tutorial videos and I'm looking for a video gallery app.
Something that would be similar to:
http://tv.telerik.com/
or
http://umbraco.org/documentation/videos/for-site-builders/datatypes/using-datatypes-that-have-prevalues
Does anyone know of any PHP or asp.net solutions?
I'd rather not re-invent th...
I have been using PHP for quite some time now and was wondering what to study for looking into advanced topic - and what advanced topics those are. Please could you offer ideas on what type of projects or functions of PHP to use (which would give the greatest ability for me to take my PHP knowledge and skill to a higher level).
...
I'm planning to use multiple file servers to host my website uploaded files. what's the best way to do it ? should I install a web server on other machines as well? or is there any special software for routing files on the network? what would you pros do?
Thanks,
Taher.
...
Im iterating through two lists dumping data into their own single array, but i need to merge the 2 arrays in numerical order into a single array.
Im using a counter (foreach and $i++) to name the keys in the proper order, but both operations leave me with arrays named with numbers 0-10.
How can i make a counter that will increment by o...
Hi guys,
In the process of building a modular cms I have come to a point where I am standardising certain parts of the system into the "core" and leaving all extras as modules.
I never had any issues when I was accessing content pages via example.com/content/about-us however it looks a little messy to have the content at a url removed ...
Alright, so I got my form to email most of the variables in php. However, my textarea variables show up blank and my textarea inputs print as "Array"
Here is a snippet from my form:
<label for="ProgramAudience">Intended Audience:</label>
<span><input type="checkbox" name="ProgramAudience[]" value="AcademicAffairsFaculty...
This might sound like a silly topic, but I'm curious what your opinions are regarding coding an application using Joomla or CodeIgniter, within the context of them being MVC frameworks.
I've spent a lot of time coding in CI, and I've gotten pretty used to the strict separation of business logic and data gathering (i.e. I can load up my...
Hello,
I am trying to turn something I requested from a MySQL table into a 'link', which is also saved in the table. Therefore, in the code below, I am trying to turn 'fldFullName' into the 'ProfileURL', both which are in the same table. After that, I should be able to click on the Full Name, say maybe John Smith, and it should take me ...
Hello,
I'm working through some PHP code and cannot figure out what the significance of the @ sign is in this code:
$data = @fread($_socket, 8192);
I wasn't able to find many other examples on php.net either that explain what @ does, instead it is just used.
Thanks
...
Hi everyone!
This is probably a simple question for you php whizzes out there but I can't seem to find an answer in google!
I have a multi-dimensional array which first set of keys are named and I want to change them into numbers like 0, 1, 2..
If it was a normal array I could set $newArray = array_values($multiArr); and it would get ...
I'm working on an overhaul of a CakePHP app I built under CakePHP 1.2. I've upgraded to 1.3 and am considering moving away from the admin routing paradigm for my application. I'm finding that some of my controllers are getting extremely large because of duplicate functions for front end and admin. My intuition is that it is much clean...
Is it possible for a PHP object instance to destroy/unset itself? Say I had a class that represented a file, and then I subsequently delete that file using the class. Can I somehow unset the instance from within one of its own methods?
$file = new FileClass();
$file->copy('/some/new/path/');
$file->delete();
// ... at this point $file...
I'm using the php mail() function and I'd like to change where the mail is comming form, ie: from the default site email to a specific email address. I'm using Dreamhost as my hosting provider.
I've tried this:
<?php
$name = $_GET['name'];
$email = $_GET['email'];
$comment = $_GET['comment'];
$todayis = date("l, F j, Y, g:i a") ;...
After writing my response on the question how to assign to multiple variables in a ternary operator I actually tried out the code I wrote:
true ? $w = 100 xor $r = 200 : $w = 300 xor $r = 400;
var_dump($w); var_dump($r);
(Don't bother it's useless, this is theoretic.)
Now, I would expect PHP to do it this way, according to operator p...
Please save me. I know that this question has been asked many times, however, I can't seem to find solutions that are relevant to my situation.
The problem: Warning: Cannot modify header information - headers already sent by (output started at /.../Sites/st.ambulance/resources/views/login.view.php:32) in /.../Sites/st.ambulance/resource...
I have a requirement to create a custom report based on data stored in a mySQL database. I would like to create a function that will render a PDF on the fly and when finished pop up a save as box or something similar for the user to save, or pop up a new window displaying the PDF giving the option for the user to save.
I have done some ...
Hi there, I don't know how to do this and I was wondering if someone smart could give me an example :)
I want someone to be able to post a png,jpg, or bmp image url and then id use PHP GD to duplicate the image including width and height.
Could someone give me an example of this? Also id like it to support only png, jpeg, and bmp.
...