php

How to add html_entity_decode to array?

I am making a content entry with TinyMCE in codeigniter. However the output source is like the following and does not show < and >. Instead it shows HTML enties like and etc. The entry is made by admin after logged in. Output comes from database. I took out escape in model, but it still does the same thing. Also I have a config ...

Wordpress Doubts

Hai I want to build a wordpress in my localhost, Is it possible to test this in My local system which is Windows 2000 Thanks in advance , ...

How to calculate PageViews of a site using Alexa stats (formula?)

As simple as it sounds, I just want to know how to calculate the PageViews of a site using Alexa stats. Alexa gives PageViews per-million and reach % of total Internet users, etc. I only want a formula using Alexa data to calculate it. I know, Alexa data is not exact but my problem will be solved by that. Thanks in advance. ...

is there something wrong with using php's native mail function?

i tried googling but sadly i get only documentations (or am i using bad keywords) anyway i can see that alot of programmers (even those im working with right now) does not seem to approve to using the php native mail function and resorts to using some other framework like sendmail? swift mailer etc... i'd like to know why? are there rea...

PHP mail line break problem

I want to format content of the mail to show the content in different line. here is my message contetn. bu the \n and \r is not working in this case. it just shows all the content in one line. $message = 'Thank you for using . We really appreciate your business.'."\r\n".'If you are making your payment by mail, please make the check ...

Image upload with Codeigniter, Redux and SWFUpload. "Not Authenticated" when browser uploads.

I have an image upload form in a secured (with Redux) admin area of my website. When SWFAddress uploads it's not seen as logged in. I created a multiple image upload form with SWFUpload and a back-end script with CodeIgniter. To cut a long painful story short - it all worked fine and dandy with the security turned off for testing purpos...

Any way to keep curl's cookies in memory and not on disk

I'm doing some cURL work in php 5.3.0. I'm wondering if there is any way to tell the curl handle/object to keep the cookies in memory (assuming I'm reusing the same handle for multiple requests), or to somehow return them and let me pass them back when making a new handle. Theres this long accepted method for getting them in/out of the...

Is there a script for generating a migration SQL (postgres) file?

On a project I work I have sometimes have to deal with changes on the table structure, like adding fields. Is there a script that can I use for generate a migration SQL file with only the changes? PHP, bash or Perl would be nice. The database is postgresql. ...

Twitter status stopped working

Hi I've been using this code to display my status on a site $doc = new DOMDocument(); # load the RSS if($doc->load('http://twitter.com/statuses/user_timeline/12345678.rss')) { # number of tweets to display. 20 is the maximum $max_tweets = 3; $i = 1; foreach ($doc->getElementsByTagName('item') as $node) { # fetch the title from t...

Algorithm to find longest anagram

Let's say that we have a dictionary of about 250.000 words. Algorithm should take in 12 letters as an array or a string and find the permutation (or is it variation or combination?) that matches longest word from a dictionary. So, it is not a real permutation, as not all of the letters are used. Of course, one can always brute-force it,...

lowest common denominator when working with CSV and MySQL

I am working on a program to allow a user to edit data from either a MySQL DB table, or an uploaded CSV file. I am curious as to what format i can bring the two data types into where i can code a singular presentation model to present the data to the user. Should i convert the SQL to CSV, or try to go through both types and do something...

Performance: PHP Error Handling and Regex

Hello all, I have two questions, one is wordy and one programmy! 1) I know that PHP reporting on notices causes performnace problems (takes time to report on these errors and figure out what sort of error it is) but is this the same case if error_reporting is turned off? I guess it still does slow down performance but not as much as di...

How would I get the birthdays of friends who are celebrating their birthday this week, this month and next month using MYSQL and PHP?

I am currently working in an site which needs to get the birthdays of friends who are celebrating their birthday this week, this month and next month using MYSQL and PHP. How would I go about this? ...

SQL to show all entries within a number of categories

Hi, I'm writing an sql query on three tables which finds and displays categories and all the entries within each category For example Category 1 post 1 post 2 post 3 post 4 Category 2 post 5 post 6 Category 3 post 7 post 8 etc I have the categories displaying but can only get one item from each. Can anyone suggest a better approac...

Is switching from PHP to Python worth the trouble

If you had switched from php + (framework of choice) to python + (framework of choice) as your development platform, what would you say have been the upsides/gains of the switch? What I want to know is if there were any significant improvements in the following aspects: Speed of development Maintainability of the finished solutions ...

Jquery Post + run php file > hide the form > give message...

Hi friends, here is my code about jquery post. I can't make it work somehow. I spent hours :( what I miss here?! when I run the code, It loads same page :( I want it to run the php code under query.php and hide the contact form and give "thanks!" message at send submit button click. (with no page loading) appreciate helps...

json_encode and nested objects

I have nested PHP objects that I would like to save in memcache. Can I use json_encode(), json_decode() to store/retrieve the data from memcache? Implicit in the question is whether the json_encode() function is "clever" enough to introspect my objects without me having to explicitly define the structure. if json_encode() is not the wa...

Does php include toupper and tolower functions?

does php include any function like toupper and tolower I want toupper fuction which convert ABC to abc or Abc to abc simlary tolower shold convert ABC to abc or Abc to Abc ...

Emulating a value type structure class in PHP

Is there any way to emulate a structure class in PHP? ie a class which passes by value and not by reference, so it can still be type hinted... And if so, what different techniques could be used? What's the best technique? If this is possible you could obviously create a fully type safe layer for PHP, are there such layers? Has anyone h...

MySQL and PHP array storing question

I have an array with 1440 vars in it. something like: $array = array(1 => 45.76, 2 => 67.56, 3 = 79.23 ..... 1440 => 20.22); This array is serialized and inserted into MySQL table with longtext as field type. What I'm facing now is a table with 700MB of data and that will mean some serious problems in the near future. Is there a bet...