I have this big function (1300+ lines of code) that takes data from the web and insert it into a local database. Each time the function runs its takes something like 20 seconds to complete and I need to run this function like a million times, so I use set_time_limit(0) to set the PHP time limit to infinite and I loop the function a milli...
I have a PHP file which produces an Xml sitemap based on data which has been imported from a number of sources. My sitemap is currently not well formed due to an illegal character in one line of the imported data however I am struggling to remove it.
The character looks to represent the 'squared' or superscript 2, and is represented a...
Chinese/Japan/Korean char is double-byte or Unicode.
...
I was trying to understand how sessions work in PHP and found that session data is by default stored in the file system. In a shared hosting environment, session data can be read by PHP scripts written by any user. How can this be prevented ?
...
Hi,
I'm loading a json file for a bunch of markers on my google map (verison 3 api) and then placing infoWindows for each marker. It all works swimmingly well except that the markers are ignoring the latlng information, and when markers are clicked the windows simply stack over the original marker. Everything works perfectly except for ...
I'm using fsockopen on a small cronjob to read and parse feeds on different servers. For the most past, this works very well. Yet on some servers, I get very weird lines in the response, like this:
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
11
<item>
<title>
1f
July...
I know WHERE, LIKE, IN filters in database. But how can I filter with "except" ? I want to select all data except a specificdata.
Thanks in advance
...
Question
Is there a way I can make PHP ignore re-declarations of classes rather than barf up a FATAL ERROR? Or at least throw an exception? (I could easily catch it then and proceed (as well a log the attempted autoloading).)
I'm guessing no and a fatal error is a fatal error - after all, in ninety-nine out of a hundred cases, that's r...
I'm working on a world clock web application, and I'd like to add a function to note how and when each location will next undergo a DST change.
I'm using the DateTime and DateTime::Timezone CPAN modules, which seem to provide every conceivable function apart from this one! DateTime::Timezone is an implementation of the tz/Olson database...
I'm adding an if statement to my database abstraction layer to pick out any attempted queries to a handful of database tables.
Basically, if my application attempts to create, read or destroy data from a database table called either members or members_profiles I want to invoke my if statement.
if (
preg_match('/INSERT INTO [members...
Hi everyone,
my application geting Text from a input field an post it over ajax to a php file for saving it to db.
var title = encodeURIComponent($('#title').val());
if I escape() the title it is all OK but i have Problems with "+" character. So i use the encodeURIComponent().
Now i habe a Problem with german special characters like...
In my application a user can create his/her photo album.
My question is how can I upload images specific to that user-id who has uploaded them? This means there should be some criteria that will indicate that these images belong to this user.
What I was thinking that I can store images with the image name of the user-id, but in that ca...
hi
i want to know how to take print the file using php programming.
i have .doc and .txt file.
i would like to print the file in printer using php programming.
any one?
thanks in advance.
...
how can i get started with Doctrine 2 + ZF? any tutorials or resources?
on a side note, i hear ZF2 will use Doctrine as its models, true?
...
parse_ini_file could be used to get configuration values from an ini file to use in the code, suppose your app changes some of those values and you want to set new defaults, is there a function to take the associative array and write the ini file over?
...
I was reading that you have to be careful with floating point comparisons and calculations in PHP. I'm not an expert at PHP so I thought I would ask the community what is the best way to do accurate decimal calculations in PHP.
I'm developing a timecard application where it calculates all the time entered for the week. Anything over 40 ...
The code for my encryption controller is shown below. This works fine by itself in a separate working directory from my kohana installation.
class Controller_Crypt extends Controller_Home
{
public static function Encrypt_This($sensitive)
{
//file path must be relative to directory, also derp.
$pubkey = open...
im using IMAGETTFTEXT function in php for writing text on some images.now i want to write html tags on my image,for example IMG tag.
i dont know how to do that!i want help plz.
here is my code :
$font_file = 'times.ttf';
$font_size=15;
$image_file= 'new.jpg';
$image = imagecreatefromjpeg($image_file);
$font_color = imagec...
I have a date value posted from php using jquery (MMDDYYYY)and i want to convert this date format to YYYYMMDD using php .
$fromDate=str_replace("'","''",trim($_POST['tx_fromDateDsp']));
echo "-->".$year = substr($fromDate, 6, 4)."<br>";
echo "-->".$month = substr($fromDate, 0, 2)."<br>";
...
Hi there,
Currently i'm having a problem. I want to access the data available in the 4th table of my DB.
Click here to see the db image
I have the tables in this way: Categories --> Categories_Companies --> Companies --> Affiliates
Like it shows in the image i'm on the categories and in the Categories view (views/categories/view.ctp)...