Hi,
I'm trying to avoid the memory leak in PHP. When I create a object and unset it at the end it's still in memory. The unset looks like:
$obj = NULL;
unset($obj);
Still this will not help.
My question is what will happen when I fork the proccess and the object will be created and destructed in the child thread? Will this be the sa...
I need to read the data from a file that can be either comma or tab delimited. I now that there is a function getcsv but it accepts only one possible delimiter.
Any ideas how to handle this?
Thanks.
...
I have been set a challenge to create an indexer that takes all words 4 characters or more, and stores them in a database along with how many times the word was used.
I have to run this indexer on 4,000 txt files. Currently, it takes about 12-15 minutes - and I'm wondering if anyone has a suggestion for speeding things up?
Currently...
I've searched for this and everything I find is way more than I need. I've done this in JavaScript before, but I would really prefer using PHP. How would I go about displaying a message to my visitors, depending on which browser they're using?
Example:
IE User would see: "You're using Internet Explorer"
Firefox User would see: "...
Ok I know this is simple, in fact damn simple, I did this in the last project about a week ago, but I don't know why it has skipped off my head.
Input:
$word = "stack";
What I want to do is:
$array = array("s", "t", "a", "c", "k");
Any help will be appreciated!
...
Hello,
I am currently looking into spliting a very long string that could contain HTML characteristics.
Once example is:
Thiiiissssaaaveryyyylonnngggstringgg
For this I have used this function in the past:
function split($sString, $iCount = 75)
{
$text = $sString;
$new_text = '';
$text_1 = explode('>',$text);
$sizeof ...
I want to crop an image. Is it possible to do like this. And if yes, how would the crop() function look like?
$imgURL is always a .jpg image.
$image = file_get_contents($imgURL);
$maxWidth = 100;
$height = 68;
$image = crop($image, $maxWidth, $height);
file_put_contents("media/imgname.jpg", $image);
function crop($image, $maxWidth, ...
Is anywhere written( tutorial or documentation ) how work properly with options in custom symfony task?
class mloMaintainceTask extends sfBaseTask
{
protected function configure()
{
// ...
$this->setOptions(array(
new sfCommandOption('mloOption');
));
}
private function method3()
{
return $this->getOptio...
As a web developer I am using PHP and I know that I have to worry about security but when you use a framework, there is a lot-of code and design that you relay on but that you didn't code or design and for instance I am using CakePHP.
so in this case with frameworks how much should i worry about security ?
...
I work for a travel agency, they have a website, from here they want to give the option to their travels to create their own subdomain with a wordpress blog inside.
More or less what the webpage http://wordpress.com/ offers its users.
What do I need? And plz links.
...
Hi
Just looked at function
str_pad($input, $pad_length, $pad_str, [STR_PAD_RIGHT, STR_PAD_LEFT, or STR_PAD_BOTH])
which helps to pad some string on left, right or on both sides of a given input.
Is there any php function which I can use to insert a string inside an input string?
for example ..
$input = "abcdef";
$pad_str = "@";...
I am trying to include the Zend_Service_Amazon_S3 file by using
require_once 'Zend/Service/Amazon/S3.php';
I have also included in the include path the directory where the entire Zend library is located, AND the installation is inside Zend Server CE (which includes the Zend Framework by default). However, no matter what I try, I only ...
XSLTProcessor::hasExsltSupport() returns true. Now what do I have to modify so I can use it?
I have
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date">
Transformation what I'm tr...
I have text file with some stuff that i would like to put into array. That text file has one value per line. How do i put each line into array?
...
I'm looking for a plugin or lightweight js-editor, which supports tabs in a textarea.
Anybody?
Kind regards,
Joerg
...
I wish to persist some extra data in a many-to-many relationship by having some extra fields in the association table. For instance, I would like to keep track of what role a user has in a network, such as 'member', 'moderator', 'admin' etc. I would also like to keep track of when he/she joined the network. Now, what I am looking for is ...
Hello,
I have a simple query: $query = new WP_Query('showposts=5'); that will obviously display 5 latest posts. Is there any way to be able to get post's position in the query? By position I mean... $query has 5 posts, and I need to be able to display the number of a post in the loop. I don't really know PHP but I'm assuming the $query ...
hi
am getting this error when i open my site in internet explorer......... plz help me.
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
/* Definitions */
define( 'BASEPATH', dirname(__FILE__) );
include_once (BASEPATH.'/layout_vars.php');
// Menu
$document = &JFactory::getDocum...
Hi, I am currently working on 2 web servers, One Coldfusion and the other PHP.
Right now, the Coldfusion server is my main server where users log in to access restricted data.
However, I have also begun using a PHP server and want to make it transparent for users to access a specific page on that server - that server requires log in inf...
Hay Guys.
I was wondering if anyone can help with resizing an image to 100px (wide, or high). While keep it's ratio and quality.
All this needs to do is open a given file, resize it and overwrite the file with the new version (keeping the filename).
It should only beable to do jpegs,gifs and pngs.
I'm not fussed about transparencies...