From this question: http://stackoverflow.com/questions/1524377/what-regex-pattern-do-i-need-for-this I've been using the following code:
function process($node, $replaceRules) {
if($node->hasChildNodes()) {
foreach ($node->childNodes as $childNode) {
if ($childNode instanceof DOMText) {
$text = preg_replac...
This one is completely beyond me. I'm trying to compare two strings. When I echo them, they appear to be identical, yet when I compare them with the '==' operator, it returns false. For example, when running the code below on my database. It outputs things like "APPARENTLY Apple does not equal Apple". Can anyone shed any light on this?
...
Hi am using simple_html_dom to parse some website.
Is any way to extract the doctype?
Thanx,
Granit
...
Hi All,
Can anyone guide me a way to extract all the images that are part of the email body(not as attachment) in PHP.
Please guide me if anyone has worked on this.
Regards,
Justin Samuel.
...
Picture a 5 page gallery of images, each page with about 20 images on it. Each image is associated with 2 checkboxes, "web resolution" and "print resolution" for clients to order a digital copy of the image.
The page is built in PHP. When the client is finished selecting images across all 5 pages, she clicks "Submit Order" and is taken ...
Hi,
I started this semester Databases course which I enjoy a lot. We are required to work on a project of our choice at the end of the semester. It seems that everyone in my class is gonna do it on the Web. So far so good! But I am the only one out there who don't care about Web Development, and in fact I am at best an advanced user of ...
I'm using XPath to select an section from an HTML page. However when I use XPath to extract the node, it correctly selects only the text surrounding the HTML tags and not the HTML tags themselves.
Sample HTML
<body>
<div>
At first glance you may ask, “what <i>exactly</i>
do you mean?” It means that we want ...
I'm trying to build an array within "The Loop" of values provided from various functions like the_title(), the_excerpt(), the_permalink() and others. I'd like to do something similar to what follows. The unfortunate thing is that most of these functions immediately print their results rather than returning them. Furthermore, I have check...
I’m making a self-hosted downloadable web app using CodeIgniter and I’m looking for a way to automatically redirect to the installer if the database config file has not been filled out.
The problem is that CI errors out when it tries to connect to the DB (which it obviously can’t because it’s trying to load the database config file befo...
Hi all!
I´m rewritting our database class (PDO based), and got stuck at this. I´ve been taught to both use SET NAMES utf8 and SET CHARACTER SET utf8 when working with UTF-8 in PHP and MySQL.
In PDO I now want to use the PDO::MYSQL_ATTR_INIT_COMMAND parameter, but it only supports one query.
Is SET CHARACTER SET utf8 necessary?
...
Hi.
I have a querystring that contains a search string entered by the user.
I want to search 2 fields in my table (description and headline) for the querystring..
Simply, I want to check both fields if any of the, OR BOTH, contains the querystring...
I am using PHP by the way...
SELECT * FROM db WHERE xxxxxxxxxxxxxxxxxxx?
Tha...
Hi
I want to make a validation to my files. Example my files are header.php, footer.php, sidebar.php, info.php etc. So if some of these files missed error will shown.
$required = 'header.php';
if (!file_exists($required)) {
die('Please upload files properly');
}
How to validate the all of files in simple code?
...
Hi there,
my question is simple:
How do I add an API and/or 3rd party
library to my ZendFramework
application in a way which makes it
possible to access it in a
controller
...
Hi again...
SELECT * FROM db WHERE description LIKE '$string' OR headline LIKE '$string'
My problem is that the $string variable must be exactly the same as one of the fields in order to work... But I want just a part of the field to be the same as the $string...
How can I do this?
Thanks again...
...
I'm trying preview the latest post from an rss feed on another website. The feed is UTF-8 encoded, whilst the website is ISO-8859-1 encoded. When displaying the title, I'm using;
$post_title = 'Blogging – does it pay the bills?';
echo mb_convert_encoding($post_title, 'iso-8859-1','utf-8');
// returns: Blogging ? does it pay the b...
I'm trying to parse an entire MySQL table into files named after the rows. However, it seems to miss out a lot of files, and it just isn't working properly, but I don't understand what's wrong. Here's what I'm using:
$link = mysql_connect(...); //*Let's assume this is correct*
mysql_select_db(*This too*);
$query = "SELECT * FROM rules";...
hi,
I have the following that adds the current URL to a session then displays the last 10 products associated with that URL.
The problem is that the unique_array function appears to be allowing the duplicate URLs to be added to the session:
<?php
// Make URL
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") ...
Hello all,
I pass text from a POST variable from a form on my site to Twitter and I save this message on my own site. When I view the entry on my site it is absoultly fine. However, in some cases when there is an apostrophe in the message twitter updates the status of a user but escapes the apostrophes and this can be seen on the users ...
Hello all
I am using Zend Framework.
I would like to insert array $color = array('red', 'blue', 'green', 'yellow'); into mysql, one color to one row.
How do I code this in my model file?
Controller
public function addAction()
{
$this->view->Title = "Add Colors";
$this->view->headTitle($this->view->title, 'PREPEND');
$form...
I'm running a Mac Mini with Apache/PHP5/MySQL as my staging server.
I'm building and using software that requires GDLib for manipulating graphics.
How can I install this on my machine?
Im not much of a CI guru but Im not scared of it. I just have no clue how to troubleshoot errors or problems when ./configure says file not installed at ...