I just inherited a PHP project that generates large PDF files and usually chokes after a few thousand pages and several gigs of server memory. The project was using PDFLib to generate these files 'in memory'.
I was tasked with fixing this, so the first thing I did was to send PDFLib output to a file instead of building in memory. The pr...
I have a website that's currently in English; I want to be able to switch to a different language when a user clicks on a different language (there are little country flag icons on the site). The way I'm currently trying is with arrays, e.g.:
$english = array('index',
array('h1' => 'this is some h1 text',
'h...
I program mostly in PHP and have a site along with other samples in ASP I need to convert over to PHP. Is there some kind of "translator" tool that can either enter lines of code or full slabs that attempts to output a close PHP equivalent?
Otherwise, is there an extensive table that lists comparisons (such as design215.com/toolbox/asp....
I am unable to get this script to function correctly. When i try to pass a domain to it, it always returns AVAILABLE, even for cnn.com! $message is the name of the domain that i am checking the availability of.
This is the function call;
include("domain.class.php");
// Initializing class
$domain=new domain("$message");
// Checking if...
I'm trying to append data to a Zend_Search_Lucene index but I'm getting a memory limit error on a line of on line 1584 of Zend_Search_Lucene_Index_SegmentInfo that has this
$bitCount = count(bitset_to_array($delBytes));
It runs fine on our development servers but when ported to another server that's when I get the error. The differe...
I'd like to rearrange elements in the file, I do not want to use another attribute for element ordering/arrangement.
...
Does MAMP come with the PHP CLI installed? I am trying to run a script from the command line, but using a Mac, with MAMP, and not knowing much about PHP CLI is making it difficult.
How should I set up my environment so that I can use the PHP CLI with MAMP?
...
How can I call the log() function inside the model beforeSave() function?
All three variants I used didn't work:
function beforeSave() {
#...
Debugger::log($y.' '.$ty);
log('test');
$this->log('testmodel');
}
...
I need an script for generating crossword game. I have a list of 8 words for which I wnat to generate a crossword game, let's say for 15 column and 15 row.
I am not getting the concept of this problem. How to generate this using PHP ?? Can anyone tell me how to do that ??
...
Hello
I am coding search engine using Zend Framework Lucene. I'm trying to make fuzzy query:
"name:sxample~"
When I put it into Luke - it founds 14 results (all with word "sample"). When I use my php code -
$query = 'name:sxample~';
$query = Zend_Search_Lucene_Search_QueryParser::parse($query,'utf-8');
try {
$hits = $index->fin...
I'm having trouble with the sql below. Basically I have rows that contains strings according to the format: 129&c=cars. I only want the digits part, e.g. 129. The sql query is:
$result = mysql_query("SELECT * FROM " . $db_table . " WHERE id LIKE '" . $id . "%'");
Why doesn't % work? I can't use %...% because it catches too much.
...
Actually, it's gotten so messy that I'm not even sure curl is the culprit. So, here's the php:
$creds = array(
'pw' => "xxxx",
'login' => "user"
);
$login_url = "https://www.example.net/login-form"; //action value in real form.
$loginpage = curl_init();
curl_setopt($loginpage, CURLOPT_HEADER, 1);
curl_setopt($loginpage, C...
I need to remove the first forward slash inside link formatted like this:
/directory/link.php
I need to have:
directory/link.php
I'm not literate in regular expressions (preg_replace?) and those slashes are killing me..
I need your help stackoverflow!
Thank you very much!
...
Possible Duplicate:
Avoid being blocked by web mail companies for mass/bulk emailing ?
Hi all,
if I send many emails per day (100s or 1000s) to users, style "someone commented on your picture" etc..., what are the best practices to avoid that these emails are labeled spam and blocked? I already have an opt-in (ie. users check a...
I'm trying to cut a chunk of text down to around 30 characters. If it's shorter, I want the previous string. On top of that, it has forum-style code in. I want to strip out everything between square-brackets ([])
I'm using a pair of functions to do that. forum_extract is what I call.
function forum_extract($text) {
return str_r...
I'd like to easily access the logs of a server to interpret them in a way and display that data to a website visitor. How can PHP access the HTTP logs of a server and all data therein?
...
I am doing a slidesshow image in javascript:
function ImageLoop( images, speed, width, height ,inc){
this.img = images;
this.speed = speed;
this.width = width;
this.height = height;
this.interval = false;
this.play = false;
if (inc > this.img.length-1){
this.index = this.img.length-1;
} else {
this.index = in...
Now I'm not making use of any compression method,just put the below between the body tag:
<link rel="stylesheet" type="text/css" href="Client/Css/all.css" />
Is it possible to use ob_start("ob_gzhandler") in PHP to compress this css file?
And how?
...
Hello,
Using PHP, what would be a simple way to use XQuery to find the first instance of a given HTML element and then replace all the HTML inside that element?
So far, I've got this:
$myHTML = '<strong>Some <em>HTML</em></strong>';
$domDocument = new DOMDocument('1.0');
@$domDocument->loadHTML($content);
$xpd = new DOMXPath($domDocum...
I'm trying to implement Google Friend Connect as a sign in solution. I've implemented Facebook Connect using the PHP client, and I'd like to use the same approach for Google Friend Connect (OpenSocial), using the opensocial-php-client (http://code.google.com/p/opensocial-php-client/). Once the user has connected, I'd like to get their ...