I wonder, how am I supposed to know which libraries I should include in my php.ini file when using a certain function.
For instance, I just looked up pg_connect(), and I wonder which libraries I should include.
I can think of php_pgsql.dll, but that's about it. Do I need others? I wouldn't know, since that doesn't seem to be documented...
Lets say I have a string - $string = "This is my test case for an example."
If I do explode based on ' ' I get an Array('This','is','my','test','case','for','an','example.');
What I want is an explode for every other space: Array('This is','my test','case for','an example.').
The string may have an odd # of words, so the last item in ...
I'd like a regexp or other string which can replace everything except alphanumeric chars (a-z and 0-9) from a string. All things such as ,@#$(@*810 should be stripped. Any ideas?
Edit: I now need this to strip everything but allow dots, so everything but a-z, 1-9, .. Ideas?
...
Hi,
I need to transform my nested sets structure (mysql) into json for this spacetree
1) http://blog.thejit.org/wp-content/jit-1.0a/examples/spacetree.html
I found this function to create an array from nested sets:
2) http://semlabs.co.uk/journal/converting-nested-set-model-data-in-to-multi-dimensional-arrays-in-php
I can also convert...
Can someone recommend an up to date library for data Sanitization in PHP ?
I am looking for a library that proposes a set of functions for data sanitization. Email validation/sanitization (remove those %0A, \r...), strip htlm (stripslashes(htmlentities), remove script, SQL injection … any form of exploit related to data submitted by use...
Looking for a good set of base objects to start a website up in PHP. I am not looking for links to CakePHP as I am not interested in frameworks. I am looking for a set of objects that would come handy to start off with for new projects...
Objects such as:
Loggers
MySQL wrapper object
etc
Basically a "Start with this", I remember s...
I'm trying to implement OpenID on my site. I've got Google, Yahoo! and ClaimID working so far, but AOL tells me "Invalid devId or Site not registered.". So how do I register my site and/or get a devID and pass it along? I'm using JanRain/PHP OpenID. AOL's dev blog is just a mess.
...
I'm using the JQuery .ajax method to get the results of a simple PHP query in XML (which I've done various times within this project without a problem). However, the XML result that I receive from within my main project is different to what I expect (as tested by simply viewing the PHP file) when viewing the results in Firebug's console...
Hello guys,
I'm trying to get into PDO details. So I coded this:
$cn = getConnection();
// get table sequence
$comando = "call p_generate_seq('bitacora')";
$id = getValue($cn, $comando);
//$comando = 'INSERT INTO dsa_bitacora (id, estado, fch_creacion) VALUES (?, ?, ?)';
$comando = 'INSERT INTO dsa_bitacora (id, estado, fch_creacion)...
Maybe I'm missing it somewhere in the PHP manual, but what exactly is the difference between an error and an exception? The only difference that I can see is that errors and exceptions are handled differently. But what causes an exception and what causes an error?
...
I am wondering why this framework (QCodo) is almost forgotten and totally unpopular.
I've started using it a few years ago and it is the only thing that keeps me with PHP. Yeah ... its development is stuck (that's why there is now more active branch Qcubed) but it is still very good piece of software.
Its main advantages:
Event driv...
I keep getting this error in line 54 and I don't know why.
All that I'm trying to do is to process the first entry of the query result: extract it's URL so as to construct an embeddable video object.
<?php
function extractID($youtubeURL)
{
//split off the final bit of the URL beginning with ‘=’
$youtubeID = strc...
Hey guys,
I'm trying to read POST data in a PHP script.
My first instincts led me to the $_POST[] array, but for whatever reason, it's never populated.
I'm using HTTP Client for OS X, http://ditchnet.org/httpclient/ to send POST requests.
I enter the URL of the script, set the method to POST, set the content-type header to text/plain ...
I'm trying to create a new project in NetBeans PHP from existing sources. When I try to create a new project, it asks me for the location of an Index File. What is an Index File in the context of NetBeans?
...
I think I must be missing something obvious here. I have Doctrine and Zend Framework set up together. In the bootstrap.php file I have the following - based on the Doctrine documentation for using the profiler:
$profiler = new Doctrine_Connection_Profiler();
$conn = Doctrine_Manager::connection();
$conn->setListener($profiler);
(...)
...
I am planning to begin working on my first personal project this June: a community about students. What I want to have is a wiki, full with information about universities, a forum where people can discuss and a blog with news, articles, etc, all three of them integrated to eachother.
Now, the way to go seems like wordpress+mediawiki+som...
I recently had an interview at a small company that wants to greatly increase its web presence, including re-writing their Flash homepage and opening an e-commerce site. If given the position, I would be the sole developer on staff.
I've been working with Rails for a number of years, and haven't looked at PHP in quite some time. However...
Im getting T_String error on this code, its saying more accuratly on the 2nd line ($form['com...) and i simply cant see why.
function _maxlength_comment_type_form_alter(&$form, $form_state, $form_id) {
$form['comment']['comment_max_length'] = array(
'#type' => 'select',
'#title' => t('Maximum comment length'),
'#defau...
test.php
<?php
$filec = fopen('test.txt','w');
$arr = file('test.txt');
foreach ($arr as $key => $value) {
fwrite($filec,$value);
}
fclose($filec);
?>
test.txt
asdjlaksjd
asdhfwejkyhtjkre
jfdhgdjkf'hgjldsff
sfjnkbnm,cv
sm,nxcm,b,
sdjlhfskld
jfsdfwerwlur
slfdjsdkljfklsdjf
When I run test.php, test.txt is emptied. Does anyone ...
Hi Folks
Looking for some good advice on db design for tracking multiple banner impressions.
IE I have 5 Banners over x Domains
I would like to build data on each banner on how many impressions per day per banner etc. So also be able to do lookups for other date ranges.
Would it be best to have a date per day per row or just track ea...