php

search and display string from group of string php

hi i want to know how to search and display string from group of string like google display the word which we search... the following example from google search word is google books result Search and preview millions of books from libraries and publishers worldwide using Google Book Search. Discover a new favorite or unearth an old ...

extract associative array within an array in php

i have an array like this Array ( [0] => Array ( [s_id] => 4 [si_id] => sec_1 [d_id] => dep_4 [s_name] => sec1 [s_location] => LA [s_visibility] => yes [s_created_date] => 1273639343 [s_last_updated_date] => 1273639343 ...

How to read information from .3gp and .mp4 using ffmpeg-php?

I have a bit of a problem with ffmpeg-php. I'm trying to get some information from video files and it works pretty fine with file formats like .avi, .mpg or .flv but when I try to use .3gp or .mp4 in: $movie = new ffmpeg_movie('path/to/file/test.3gp'); I get error like this : ffmpeg_movie::__construct() []: ISO: File Type Major Bra...

Does Apache support PHPIniDir on windows?

PHPIniDir "D:/Dev/PHP/" The above instruction can make my apache die on windows. But I'm just not sure if that's true. BTW,I found xmpp/wampserver copies the php.ini to the directory of httpd.exe,maybe for the lack of support? ...

php's preg_match returning different number of matches for same pattern

I'm trying out preg_match with a roman numeral to integer converter. The problem is, for certain inputs, preg_replace seems to be giving too few matches. The code: function romanNumeralToInt($romanNumeral) { preg_match ( '/^(M?M?M?)' .'((CM)|(CD)|((D?)(C?C?C?)))' .'((XC)|(XL)|((L?)(X?X?X?)))' .'((IX)|(IV)...

get the latest podcasts from itunes store with link by RSS, JSON or something

Hi out there, i'm trying to get the latest podcast informations out of "itunes store" to work with this data in several applications (iphone app and web app). Is there a way to get this informations? RSS, JSON or something? i want to work with this informations in objective-c and on a website with php or js. Is my question clear? :(...

MySQL connection attempt works fine in 5.2.9 but not in 5.3.0 - Help?

Hi, I'm having trouble making a secondary MySQL connection (to a separate, external DB) in my code. It works fine in PHP 5.2.9 but fails to connect in PHP 5.3.0. I'm aware of (at least some) of the changes needed to make successful MySQL connections in the newer version of PHP, and have succeeded before, so I'm not sure why it isn't wor...

Getting the most recent post based on date

Hi guys, How do I go about displaying the most recent post when I have two tables, both containing a column called creation_date This would be simple if all I had to do was get the most recent post based on posts created_on value however if a post contains replies I need to factor this into the equation. If a post has a more recent repl...

Best standards for declaring variable in php

can any one please let me know the global declaration of php variables..i have seen one among the site like.. for integer start with i, eg: $iItemId for array start with a, eg: $aItemIds for string start with s, eg: $sItemName ...

SOAP Server and Client in PHP

Hello, I am trying to develop a very simple SOAP server and Client in PHP. The goal is to receive content from a remote XML-document as the source. This is what I have done so far, I need help how to extract data from an XML file instead, as it is now, from an ordinary array. This is the function found in inventory_functions.php that i...

Call empty() on private attributes

I'm using the __get() and __set() magic methods in order to intercept external calls to some private attributes without the need of writing a setter and a getter for each attribute. So far so good: <? class Foo{ private $id; private $info = array(); private $other; public function __set($name, $value){ switch($...

why my image and first name disappears in this code?

Hi This is my foreach function <? foreach($Selected as $row) $value = $row['dPath']; $imgp = base_url()."images"."/".$value; {?> <td> <?=$row['dFrindName'].'</br>';?> <?php */?> <img src="<?=$imgp ?>" name="b1" width="90" height="80" border="0"/> </td> <? }}?> Print_r($Selected); results in `Array ( [0] => Array ( [dFri...

Set data from one specific field into a variable with PHP

i have to get data from one specific field in my database and set it into a variable (most likely this has to go into the controller), so that i can echo this on multiple pages in my webapplication. don't know if it's necassery to say, but i make use of the cakePHP framework. thanks in advance! ...

I can't upload mp3 files using Codeigniter

There are lots of suggested fixes for this but none of them work for me. I have tried making the upload class (using the following methods: http://codeigniter.com/forums/viewthread/148605/ and http://codeigniter.com/forums/viewthread/125441/). When i try to upload an mp3 i get the error message "The filetype you are attempting to upload...

Good resources for Wordpress?

Hi, I'm building quite a large site, no e-commerce, but a a lot of specific content to be managed. For some reason, the client wants Wordpress. There is no way of getting around this... I've used Wordpress before to rapidly develop blogs, but that's about it. If anything goes beyond the scope of Wordpress I'll use a framework in someth...

strange array in php

here i wrote a function , it's general purpose is to get an array of the depIds under the parent root $depId. i use recursion method to get the array: public function getEmpsByDep($depId){ $query = "select * from ".SQLPREFIX."department where id_parent=".$depId; $stmt=$this->db->query($query); while(($row=$this->db->fe...

Des decryption returns empty

Hi, I am using Des.php for decryption. For few texts descript function returns Correct output in readable text format. For few... it just returns blank(empty.) After debugging in Des.php, i found that function _unpad($text) is returning false. The input $text is also still encoded. What could be the reason? Whenever decrypt fun...

How to get the first two numbers in an integral?

How to get the first two numbers in an integral? For example: get 12 of the 123456 in PHP or JavaScript? ...

Problem with Http redirect using HTML meta tags

please see the following code // redirect to success page if ($success){ header( 'Location: ../Scripts/_lib/phpmailer-fe.php'); } else{ print "<meta http-equiv="refresh" content="0;URL=error.html">"; } its not working <form method="post" action="" enctype="multipart/form-data" name="quest"> <input type="hidden" v...

PHP: Convert <ul> <li> Tree HTML tag to an array

Hi, I'm using jsTree and I need to convert this HTML tag tree code <ul> <li> to a PHP array. The jsTree HTML tag will be passed to PHP to be parsed and store in a structured tree PHP array(see below for the PHP array structure). Additional question: Is my desired PHP array structure good or you can suggest a good structure? I'm open fo...