Hello all,
I would like to extract a zip folder to a location and to replace all files and folders except a few, how can I do this?
I currently do the following.
$backup = realpath('./backup/backup.zip');
$zip = new ZipArchive();
if ($zip->open("$backup", ZIPARCHIVE::OVERWRITE) !== TRUE) {
die ('Could not open archive');
}
$z...
I have the following function that I've added to my functions.php file in WordPress. The idea is that it gathers all of the titles of 'fsmodel' posts (a custom post type that I've created). It then returns these as an array, which I then use to populate a select tag in the custom meta fields for a second custom post type.
Basically, 'fs...
Is it bad practice to hack the main application_top.php file of osCommerce for making the desired changes?
I am using the osCommerce v2 and I an in the need of making some change in application_top.php file of osCommerce v2.0 its the main file of osCommerce product.
please guide me is it bad to do this?
My need is I have provided the ...
I can't seem to find the problem with this php function i wrote that should send an e-mail with attachment. I've been struggling with it for quite a while.
function myMail($to, $subject, $mail_msg, $filename, $contentType){
$random_hash = md5(date('r', time()));
$headers = "From: [email protected]\r\nReply-To: ".$to;
$h...
I wanted to write a function for grabbing all tweets for specified user, but it returns only 20 most recent.
I came up with something like that:
function getTweets($user) {
$page = file_get_contents("http://twitter.com/{$user}");
$from = strpos($page, "<ol id='timeline' class='statuses'>");
$to = strpos($page, "</ol>");
...
Lets say I have elements (E1, E2, ... ,En) that have individual values which varies in [1; 100]. I have a circle (see figure below) and each two circle represent range of data.
The problem is how to show distribution of these elements ofEin this circle. Figure below depicts distribution of some elements ofEin the circle, where for exam...
I'm working on the login system for a php web app. I'm aware of the dangers of rolling your own system, so I'm hoping to use a pre-built library of some kind.
I have seen zend_auth recommended in several places. I have also heard that zend_auth can be used independent of the rest of the Zend framework. This would be preferable, as my...
Hi ,
actually i have 1 query but i am unable to convert it into cakephp query format.
$result = "select * from esl_userresults,esl_lyrics where esl_userresults.esl_songID = esl_lyrics.id and esl_lyrics.song_name like '%".$esl_keyword."%'" ;
Please help
thanks
...
Do PHP5.3 have any known bug issue that makes non static variables in scope behave Static ?
I donno why in a if{}Scope I've
{
echo $_not_static;
$_not_static = 5;
}
First Time it fires E_NOTICE as it should But second time it prints 5.
I was Struggling with this for 3+ hours but not getting any hint of a fault from my side.
...
The company I work for uses two servers DEV and PROD to host its sites. DEV is obviously where we do all of our work, and PROD is where we host live sites for clients.
On DEV we have created a deployment app that is used to create new sites and perform a few other administrative tasks. Right now I am looking into a way to transfer sites...
I am using PHP as server side coding, and i want a set of values to be send to the server(in array format). how can i send that, and retrieve that array value at backend?
...
Are there any good libraries (preferably free) for working with video files and their timecodes? I especially need two kinds of functionality:
Get information about video files in as many formats as possible, but most importantly QuickTime. For example duration, bit rate, frame rate, format, dimensions, display aspect ratio, pixel aspe...
Hi All,
I need to prepare for PHP aptitude exam. I have searched on Google but I am not getting proper stuff for PHP aptitude.
I have some stuff of zend certification ( covered most of the concept ). Needed other stuff apart from zend certification.
Can any one provide me any links which has PHP aptitude questions ?
Thanks in advance ...
I'm not very clear about HAML, but as far as I know it is a templating language, and PHP already has that functionality. Would it make sense to include PHP syntax inside a HAML file or it would be redundant(?):
#navigation
%p
<?php include("navigation.html"); ?>
...
how to send array through url in PHP?
I have an array of product ids i want to use these id through url because this is the osCommerce needs it in which i am working in, how can i do it?
Generally osCommerce asks for the single product insertion which in turn gives me back a product id which i pass into the url and get it in shopping c...
Hi,
What I want, is a function that
searches through my array, and
returns all the
children to a specific node. What is
the most appropriate way to do this?
Will recursion be necessary in this case?
I have previously constructed a few quite complex functions that iterates with or without the help of recursion through multi-dimensiona...
Hey,
I need to find three previous working days from a given date, omitting weekends and holidays. This isn't a hard task in itself, but it seems that the way I was going to do it would be overly complicated, so I thought I'd ask for your opinion first.
To make things more interesting, let's make this a contest. I'm offering 300 as a b...
Is it possible to translate XSL files using PHP and gettext?
I'm building a web application where most of the user interface code is in XSL files. I'm using PHP gettext to translate PHP pages and an app called Poedit to translate the texts. All this works very well! I would need a way to translate the XSL files too, preferably so that P...
i've created a function to get plain text from HTML by striping out
JavaScript , CSS , HTML tags etc. for that i've relied upon PHP's preg_replace
function to remove certain patterns. The webpages are already stored on hard disk so i'm taking source code from disk. The function is working properly for source code from single files howev...
Hey all,
I'm implementing a function called attach. I'm looking for a way to take a param that is either a file path or a file's contents. Here's what I have:
/**
* @param name - name of the file
* @param file - either a file or a file path
*/
function attach($name, $file) {
$attachment = array();
$attachment['name'] = $n...