php

In PHP what does it mean by a function being binary-safe ?

In PHP what does it mean by a function being binary-safe ? What makes them special and where are they typically used ? ...

very Strange problem with text area value and javascript

i have a html form <form action="" method="post"> <textarea id="content" name="content"></textarea > </form> ok it work good when making var_dump($_post); but the problem is when adding any js plugin on this textarea its not give me any out put this in my new script i cant know the reason i testes many plugins like text area resize li...

Exchange a request token for an access token with Twitter API using PHP

I am new to OAuth, and am struggling to exchange a request token for an access token with the Twitter API using PHP. I am using OAuth - Consumer and Server library for PHP from http://code.google.com/p/oauth-php/ I successfully get a request token and store the token and secret in a cookie: $options = array('consumer_key' => $this->ke...

PHP PDO fetch returns a array ?

$GetUid = $dbConnect->prepare("SELECT UID FROM users WHERE username = :username"); $GetUid->execute($RegisterData3); $UserID = $GetUid->fetch(); why does it return array not a string ? var_dump('$UserID') says array 'UID' => string '45' (length=2) 0 => string '45' (length=2) it should be array 'UID' => string '45' (length=2)...

how to get latest date and time in php and mysql using a select statement

how to get latest date and time in php and mysql using a select statement? is that possible My field type is data time it looks like this "2010-06-08 01:41:27" . any help is appreciated guys. edit: sorry not so clear with my question...(ugh!) basically I have a column in my table which has a field of datetime (did I say it right, it has...

PHP Hourly Calendar, Running through timestamps stored in database.

I have a MySQL table titled 'my_cal' with a column titled 'start_time' for particular events in the calendar. The way items are added to the database, there are no overlapping events. There also may not be an event for a particular day/time either, in this case we leave it blank or put a blank value. My problem lies in the fact that ...

convert timezone identifier to name? (Asia/Calcutta to Indian Standard Time)

I am working on a php (codeigniter) project. I have been doing a lot of work in timezones to convert times between different timezones and the server timezone. I know how to convert a php timezone identifier to its abbreviation (like Asia/Calcutta to IST). But now, I need the expansion of this abbreviation (Indian Standard Time). Is th...

An explode() function that ignores characters inside quotes?

Does somebody know a quick and easy explode() like function that can ignore splitter characters that are enclosed in a pair of arbitrary characters (e.g. quotes)? Example: my_explode( "/", "This is/a string/that should be/exploded.//But 'not/here',/and 'not/here'" ); should result in an array with the following members: This is...

PHP DOM problem searching for <w:t> tags in XML

So I have an XML file (XML export of a MS Word file). What I am just trying to do is to replace these two lines: <w:t>Meno:</w:t> And: <w:t>Priezvisko:</w:t> This is a longer XML excerpt: <w:p w:rsidR="00CF175F" w:rsidRDefault="00CF175F"> − <w:r> <w:t>Meno:</w:t> </w:r> </w:p> − <w:p w:rsidR="00CF175F" w:rsidRDefault="00CF175F"> −...

How to check for null in Twig?

Hello. What construct should I use to check whether a value is NULL in a Twig template? ...

foreach in regular expression?

Possible Duplicate: php regular expression help? hi, i want to replace i like apple apple is good orange is also nice my mom likes banana apple 123 4 the pear is soo sweat my dad loves pear to i like apple apple is good orange is also nice my mom likes banana apple 1 apple 2 apple 3 apple 4 the pear is soo sweat my dad lo...

PHP DOMElement getElementsByTagName specific selector

$content = file_get_contents(http://www.domain.com/page.html); $dom = new DOMDocument(); if (!@$dom->loadHTML($content)) die ("Couldn't load file?"); $title = $dom->getElementById("cssid"); $data['heading'] = $title->nodeValue; // this works fine I would like to be able to select all p tags that are within a certain id. With Jquery ...

PHP generating and naming html for calendar to mysql database

Hello everyone, I have a PHP page where a user can select a month and then an html label and selection box will generate for each day of the month: <?php $i=1; while($i <= $daysInMonth){?> <table align="center" style="width: 435px"> <tr> <td class="style1"><p><label id="Label1"><?php echo($month.' '.$i); ?></lab...

Accessing the images folder of Joomla directly

I want to be able to access some images I have on my Joomla site from another site. e.g. I want to be able to type <img src="http://www.myjoomladomain/images/imag.jpg"&gt; in a html file on another different site and view the image. It's been telling me I do not have permission to access the folder. please how can I go about it ...

IO: Error #2038 jquery uploadify

The code is working on one server but isn't on the other. When trying to upload files of size around 1 MB with jquery uploadify I get this error. IO: Error #2038 Tried changing the following php settings in php.ini: post_max_size 32M upload_max_filesize 32M session.gc_maxlifetime 14400 max_input_time 14400 max_execution_time 14400 me...

Replacing all spaces inside <a> tags

Hi, I've been struggling with this for a while now so hopefully someone can help me out. I need to use regex to replace all spaces inside an anchor tag for example. Hello this is a string, check this <a href="http://www.google.com"&gt;Google is cool</a> Oh and this <a href="http://www.google.com/blah blah">Google is cool</a> That is al...

How to check the PHP syntax in Eclipse?

I'm using Eclipse for developing PHP applications. I want to run PHP in lint mode to check the syntax of my PHP files for any errors. How can I do this within Eclipse? Thanks for any tipp! ...

How to programatically change every method to return $this (except predefined list)?

I have a class: class Module { public function a(...params...) { //do something, doesn't return anything } public function b(...params...) { //do something, doesn't return anything } public function c(...params...) { //do something, doesn't return anything } public function get...

Is There a way to use Zend Search Lucene in a way similar to Useing the WHERE LIKE sql in Databases ?

$select = $this->_db->select()->from($this->_name,array("id","fullname","username","email"))->where("fullname LIKE '$query%'"); I am using this SQL statement currently to power my Ajax auto suggest, if i type in "a" it gets me results starting with a. I want to know if this can be accomplished my using Zend Lucene indices. ...

Recognize image with PHP

I run a site with lots of small images (www.iconfinder.com) and would like to develop a feature that can compare and recognize images. A user should be able to upload an image (icon) and then the site will respond with information about the image if it's in the database. What is the approach to finding similar (or the same image). I kno...