php

Perceptual Hash Algorithms in Python or PHP?

I've been exposed via StackOverflow to pHash, a C++ perceptual hash library for audio, video, images, and text fingerprinting - recently with preliminary bindings for PHP, C# and Java. I'm interested in studying these algorithms and I'm wondering if there are any open-source pure Python or PHP implementations of the same / similar algor...

PHP - BBCode parser - recursive [quote] with regex and preg_replace

hello, i'm making my own bbcode parser, and i've a problem when i try to do the recursive quote. this is my code : function forumBBCode($str){ $format_search=array( '#\[quote=(.*?)\](.*?)\[/quote\]#is' ); $format_replace=array( '<blockquote class="quotearea"><i><a class="lblackbu" href="./index.php?status=userview&userv=$1">$1</a> wr...

How do you map an array in php?

I have two array K = {"a", "b", "b"}; V = {"1", "2", "3"}; from these two array I want to got the result like this $display = "a: 1; b: 2; c: 3;" echo $display; output "a: 1; b: 2; c: 3;" Anybody here please give me the idea? thanks ...

Normalising/Validating user's 'City' input during registration

Hello, My problem concerns validating/normalising a user's input for the combination of Country and 'City' during registration. Ideally, I want functionality similar to the OkCupid (http://www.okcupid.com/signup) registration page where this question is asked. Loss of focus on the City input field validates the input somehow, and it is ...

What is the opposite of the PHP function date()?

Is there any function in PHP that either takes a date and turns it into a time stamp, or can simply take a date in one format and change it into another format? I have a set of dates in the format 'm d', which I want to change to 'l, F d, Y'. I will need this with dates in other formats as well, so a function that lets me give it a date...

php curl fail-over function for "couldn't connect to host"

I have a php curl script which crawls different websites . The problem is that after a while I think the websites place a kind of temporary ban on my IP and the script is unable to connect to the host anymore(as I'm getting "couldn't connect to host" error) . I would like to set a condition/function to make the script stop for a while (e...

Key Value Pairs in AS3

I have a back-end PHP script sending info to an as3 app. What I have it sending is Json info, what I did to make it a key value pair was stick a key and an equals sign in front of it, and send it off. It works on smaller values, but for some reason, it's not working with this, heres the code, I hope you guys can help. Thanks :) c3po=[{"...

File Upload Failing Mysteriously in CakePHP

I'm trying to upload a file to my server using the CakePHP file upload form helper. I am currently running CakePHP 1.3 on my development computer (Mac OSX). When the form submits, it has in the variables that are passed to the controller its temp name: /var/tmp/name and then its name as the name of the file. However, when I try to rename...

How to create a simple CMS with PHP?

I want to create a simple CMS with PHP and MySql, I use wamp as a server. Currently I just want it on my localhost. What I want is to have a front page, where are normal posts like on wordpress, just simple posts, currently I don't want comments maybe later if it works cool :). And a very simple admin panel where I can manage the posts...

Convert simple code from Perl to PHP (issue)

Possible Duplicate: Convert a Perl code to PHP Hello all, I don't know much in Perl and I'm having problems converting a simple code from Perl to PHP: here is the code: pack("SSA12AC4L", $id, $loc, $name, 'ar', $get->getIP), time))...

Is it possible to pass HTML through a PHP function's acceptable parameters?

This doesn't work: $F = "<div class='f'>F</div>"; $d = "<div class='d'>d</div>"; $Y = "<div class='y'>Y</div>"; $dateFormat = "$F, $d, $Y"; echo date($dateFormat); ...

is there any site for broadcasting live shows?

hi, please delete the question if this site is not the right place to post this question I am looking for a site where I can log in and create events that I can broadcast. broadcast will be live and users who come to the site can watch it . And when an user logs on to watch my broadcast I can see the list of users and then have chat op...

Looking for a bell curve formula to present data that has zero to full affect in a range

a=(0-100) when x=0, a should be 0 when x=100, a should be 100 the data needs to bell curve towards the 100 mark, so that once x passes 100 a will remain at 100 and not go over. Explanation and application follows: We have a number of rows of data that are counted as good, bad or questionable. If a row is bad we count it as full value...

How do I sidestep CakePHP to write to specific folders?

I'm trying to upload files into a folder, but it keeps failing and I think CakePHP is taking over the write and try to process it as a Controller. Is this true? And if so, how can I sidestep it? ...

LOAD DATA INFILE REPLACE doesn't seem to work with multiple fields?

I'm loading a file into a table with php. I create a table like this: CREATE TABLE IF NOT EXISTS $table ( `id` INT AUTO_INCREMENT PRIMARY KEY, `order` INT DEFAULT 0, `data` VARCHAR(200) UNIQUE, `cur_timestamp` TIMESTAMP DEFAULT NOW())"; And fill it from a text file like this: LOAD DATA LOCAL INFILE '".$file ."' REPLACE INTO TABLE $...

How do I add CodeIgnitor System folder to Eclipse Project - Ubuntu

So I'm pretty new to Ubuntu and even newer to Eclipse. I am trying to get started with the PHP MVC framework, CodeIgnitor. I am using the following article to setup my dev environment: http://hetal.wordpress.com/2009/09/04/working-with-eclipse-and-code-igniter/ I am trying to add the CI 'System' folder to a new project in Eclipse. I am ...

Custom object management with a user-friendly front-end

Hi all, We want to build a system to manage our customer information. The customers are assigned to sellers and seller's routes. For example, seller A will visit customer B on Monday. We want it to support several features Import data via CSV Data grid to manage the customer, including reordering of rows Batch operation (e.g. select ...

How can I create a PHP 'Download will begin shortly' page?

Hi, I'd like to create a PHP page which shows a message like Your download will begin shortly. If it does not start, please click here to restart the download i.e., the same type of page that exists on major websites. It will work like this: <a href="download.php?file=abc.zip">Click here</a> When the user clicks that link, he is...

Mixing different audio files and exporting to mp3 in ActionScript 3

Hi all, i was wondering if it is possible to mix different audio files and export them into an mp3 file for the end user to download to his computer. Actually, I know it can be done because they do it in various sites (http://aviary.com/tools/Myna , looplabs , audiotool , remixgalaxy the last 3 ones are dot coms, but I can't post them b...

how to create multi store on live server in magento

i have installed magento 1.4 on live server now i want to create my online multi store .can any body tell me how can i do it..to make my multi store live on server....thanks ...