php

Extended class not found when Base class is in a separate include file

This doesn't work: test.php: include_once('test-include.php'); $main = new mainClass(); //====================================================================== class mainClass { function __construct() { $test2 = new Test2(); echo $test2->var; } } //===============================================================...

PHP regular expression to remove tags in HTML document

Say I have the following text ..(content)............. <A HREF="http://foo.com/content" >blah blah blah </A> ...(continue content)... I want to delete the link and I want to delete the tag (while keeping the text in between). How do I do this with a regular expression (since the URLs will all be different) Much thanks ...

Integrating Images in a Docbook Manual in conjunction with phpDocumentor

Hi, is there a possibility to include images into a docbook manual compiled by phpDocumentor? I tried both: <mediaobject> <imageobject> <imagedata fileref="payment_flowchart.png" format="png"/> </imageobject> </mediaobject> and: <figure><title>foo</title> <graphic fileref="payment_flowchart.png"/> </figure> Then again the i...

Possible for Google Bot to Execute PHP Script

Hello, I have a CRON job php script that I just set up not too long ago. However, I noticed that the PHP file executed (without the cron job activating). It appears that it happened when a Google Bot crawled the file, because I noticed that the following engine visited my page: http://www.google.com/bot.html My question is: 1) Is ...

Deleting __MACOSX folder with PHP?

Has anyone had any experience with deleting the __MACOSX folder with PHP? The folder was generated after I unzipped an archive, but I can't seem to do delete it. The is_dir function returns false on the file, making the recursive delete scripts fail (because inside the archive is the 'temp' files) so the directory isn't empty. Any ide...

How do I replace "new line" characters inside double quotes in php?

Ok, I have a csv file like this: 14 ; 1234,56 ; 10203 ; "ABC" ; "DFG" ; "Lorem \n ipsum \n dolor sit" \n 15 ; 234,16 ; 10204 ; "ABC" ; "DFG" ; "Lorem \n ipsum \n dolor sit" \n 16 ; 1234,15 ; 10304 ; "CCC" ; "DFG" ; "Lorem ipsum/dolor \n sit amet\consec" \n and so on... The file has almost 550000 lines. How do I replace all \n charact...

Will PHP become a full fledged statically typed OOP language in the near future or ever?

I was wondering whether it is the intent of the development team of the PHP language to make it into a full fledged statically typed OOP language at some point. Any ideas about this? Edit: To add to that: Will this be a performance hit for a non-compiled language? Or are there similar purpose scripting languages that have these capabili...

Is there a reason this doesn't work?

A simple HTML form: <form enctype="application/x-www-form-urlencoded" method="post" action="/view/album/id/4"><ol> <li class="no-padding"><div class="element"> <input type="hidden" name="media" value="" id="media" /></div></li> <li class="no-padding"><div class="button"> <input type="submit" name="add_to_favorites" id="add_to_favorites...

Php Curl multiple request problem

Hi, I am having a problem using the curl lib with php. What I want to accomplish is to make multiple request pulling xml returned from two different url's that are called with curl. Here is the code: $BROWSER="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 YFF3 Firefox/3.0.1"; $ch = curl_init(); curl_seto...

Scheduling Script with PHP/MySQL - Help with Logic

Hello all, I'm looking to develop a small script where users can insert their "schedule." However, I need some help determining the logic of how to create the DB structure and how to input the "time" of the events in the database. One thing to note, however, is that when users enter their "schedule", they will not be entering exact da...

Should I implement multi-purpose functions?

I'm using CodeIgniter and I got a model that fetches let's say all recipes where you can set the offset and the limit. Should I extend that function for retrieving a single recipe? Is it good practice? ...

Ajax (jquery) vs php redirect ideas?

Before I throw something ugly together I thought this would be a good one to ask the experts. So I've got a button that a user can click that: a) Passes a variable from the element to a jquery function and posts to a php script like so (this works fine, though there is probably an easier way): $(".complete_btn").live("click", function...

Help with mod rewrite redirecting to new url

Hello, The following url rewrite works fine but it doesn't redirect to the new url. RewriteRule ^test-(.*)-(.*)\.html$ /test.php?&abc=$1&xyz=$2/ [L] ...

How to get the character from unicode value in PHP?

For example, how to get the character corresponding to 010F? ...

Use regex/php to read text inside quotations

I have a text title that reads This User "The Title Of The Post" I want to grab just whats INSIDE of the quotation marks, and store it in a variable. How would i do this with regex and php? ...

Loading Markdownify in CodeIgniter

Hi, I downloaded Markdownify from http://milianw.de/projects/markdownify/ and extracted it to my application/libraries/ directory. I did a: $this->load->library('markdownify'); echo $this->markdownify->parseString('<b>Test</b>'); But the output is the same html markup. It didn’t work. How do I get it working? ...

All of a sudden, my Amazon S3 HTTP requests aren't working. Signature Does Not Match error. Help?

My code was working just fine a couple days ago. Then, all of a sudden, BAM: it stopped working. My PUTs stopped going through, with a SignatureDoesNotMatch error. Help? require_once 'Crypt/HMAC.php'; require_once 'HTTP/Request.php'; function uploadFile($path_to_file, $store_file_as, $bucket, $debugmode = false) { $S3_URL = "...

How to view object's data in php

Hello when I want to test php array I use the following code print_r($myarray); but know I want to see the data of an object my object is $xpath = new DOMXPath($doc); $myobject = $xpath->query('//*[ancestor-or-self::a]'); when I use print_r($myobject); I get that output DOMNodeList Object ( ) I want to i...

regex/php: parse times from string?

What is the best way to parse time from a string? Example string: "this is 10:45 this is 10:48, 10:49, 10:50, 22:15"; Expected return: [0] = 10:45 [1] = 10:48 [2] = 10:49 [3] = 10:50 [4] = 22:15 Thanks for any replies!! ...

resize animated GIFs with phpthumb

Im trying to use the phpThumb program to re-size an animated gif. But when i use it just as the site explains it in the demo, my re-sized GIF is single frame only. Anyone have experience with this software that could offer tip? The line im using is phpthumb.php?src=/anitest/images/animation.gif&w=125&f=gif Here is link of demo im us...