php5

PHP: Add words to pspell?

I am using pspell like this: $ps = pspell_new("en"); if(!pspell_check($ps, $word)) { $suggestion = pspell_suggest($ps, $word); } However I want to added some industry terms to the list. I looked up pspell_add_to_session which says the first param is supposed to be int $dictionary_link But I do not know what that is and there i...

passing an comma delineated list to a custom wordpress query

Ok, so here's what is going on... I am pulling a list of the most popular post titles from Google Analytics and I'm placing them in an array $thisnumber = 0; $start = date('Y-m-d', (time() - (60 * 60 * 24 * 30))); $end = date('Y-m-d'); $limit = $getnumber; $titles = array(); $login = new GADWidgetData(); $ga = new GALib($login->auth_...

Wordpress get posted in category permalink

So each post it will be posted in one category, and for each post I want to get the posted in category permalink, only the URL without markup. How can I do that? //Explained again Well the post is posted in a category, right? Well I need to show that category, but not the name of the category, the url for that category. ...

How to extends use variable

$laca = 'laca'; class laca(){ /*Code*/ } class foo extends $laca; This code doesn't work. I want to make a DB class, and then have some DB driver : mysql, mssql v..v. $db = 'mysql'; So I want the DB class to extend mysql. Sorry for my bad English. ...

Background update via PHP??

I don't know if it is possible only with PHP but thought will ask here... I do have a PHP code which updates data every 15 days. my problem is when it updates the entire process taking more than 5 seconds so user must wait until the updates done. what I am looking is I want to do an background update while user is viewing the content. ...

DBFactory, works only use static

-------Now, another question class DBFactory { static function create(){ return new MysqlDB(); } } class MysqlDB{ function alo(){ echo 'ok'; } } $db = DBFactory::create(); $db->alo(); --->Works class DBFactory { function create(...

Code igniter - Special Characters/Date in URL

Codeigniter has this configuration setting $config['permitted_uri_chars'] = ''; using which we can specify which characters are allowed in the query string. I have to accept date in my URL, the format is : Y/m/d H:i:s The normal code igniter allowed URL character set is not allowing this date. For now I have set $config['permitted_u...

PHP: extend existing class

Hello. Is it possible to set the parent of the class? I.e. an instance of the parent class gets instantiated during runtime and then a child class instance extending a certain parent instance gets created. For example: class A { var $test = 'default'; } class B extends A { public function __contsruct(A $a) { parent = $a...

Echo Return construct method;

<?php class DBFactory { function __construct(){ return 'Need to echo'; } } $db = new DBFactory; echo $db; ?> Not works :( ...

How to insert the data from excell file to Mysql table using PHP?

I want to insert the data from given excel sheet to mysql table.I am using PHP 5.0.If it is not possible is there is any option for convert excel to CSV then Inert into Mysql table? ...

How do I parse visitors by country info from alexa??

if you search alexa with any URL's you will get a detailed traffic information of the same. what I am looking into is I would like to parse Visitors by Country info from alexa. example for google.com url is - http://www.alexa.com/siteinfo/google.com. on the Audience tab you can see: Visitors by Country for Google.com United States 3...

Run a dll file in PHP

Hi, i have a dll file with me. I know the source code of it and also know what methods it has. What i want is to call that dll file through php. I should be able to pass parameters to that dll file and return values from that file both in PHp. After a google search what i find is, we have COM and DOTNET class available in php for reading...

is_file or file_exists not working in apache but in CLI

Hi, I have a very strange behavior with is_file() or file_exists() function. <?php $nfsFile = '/mnt/nfsdir/file.txt'; var_dump(is_file($nfsFile)); ?> this code returns FALSE all the time, but: $#php -r 'var_dump(is_file('/mnt/nfsdir/file.txt'));' returns TRUE, which is correct. I'm running Debian Squeeze, Apache 2.2.15...

Can we use constants in place of property name in assigning values to class properties.?

Suppose, i have class, define('property', 'test'); class myClass { public $test; } $obj=new myClass; Can i use like this, $obj->property="value"; Is there any way to achieve this? ...

How to specify a specific delimiter when reading a text file from PHP?

I have a text file, I am told the delimiter is as quoted below. My question is how to I set the delimiter inside PHP? ie this would set it as TAB delimiter in my script $csv->delimiter = "\t"; # tab delimited Field Separator (FS): SOH (ASCII character 1) Record Separator (RS) : STX (ASCII character 2) + "\n" For example, these ...

Truncate file ('w') not working for a chat application

Hello, I've made a chat application for a website. Everything is working fine, however, I am trying to make a situation where when the user clicks 'logout', the chat box system will show to other users that the specific user has indeed logged out of the room, and then it will proceed to clear all old messages on the user's screen who ha...

How to save a phpthumb output into a file?

I am trying to save PhpThumb output. As what I could find on-line was not sufficient or to complex,I would like to ask if any one knows how to it? $thumb_src="\"phpThumb/phpThumb.php?src=../apartmentsPhotos/".$num['ref']."/1.JPG&h=119&q=100\""; echo" '<'img src=".$thumb_src />"; So what I want to do is to save the img src into an Imag...

Curl to get contents of gmap co-ordinates looking very slow

I just replaced file_get_contents() to curl code as that is running very slow. But after curl too is slow. Can anyone please tell me anything wrong with my code? $myurl = "http://maps.google.com/maps/geo?q=" . urlencode($address) . "&output=xml&key=MY API KEY"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $myurl); ...

Wordpress, IIS7, Permalinks and index.php

I know this question may have been asked before, but I have read hundreds of posts all over the Internets and nothing has worked... I have a wordpress install (WP 3.0), running on MySQL and PHP 5.2.6. I'm trying to get the permalinks to just be site.com/postname. When I set the permalinks in the settings to just be /%postname% It d...

Confused over newlines, Unix and PHP

I am using http://code.google.com/p/parsecsv-for-php/ to parse my text file. Using that I have told it that my delimiter is chr(1) which appears to work, however it is taking line feeds also as record breaks (which I specifically don't want it to do....) By default the script says to look for these as linefeeds: var $linefeed = "\r\n...