Hello all,
I am trying to match a html element but I don't think its matching since $titles is empty - can anyone correct me?
My preg_match:
preg_match_all("~<td align=\"left\" width=\"50%\">[^<]*. <b><a href=\"(.*?)\">[^<]*</a>~i", $main, $titles);
Example HTML to match:
//<td align="left" width="50%">1. <b><a title="Wat" href=...
How would you convert a datestring that will be formated like...
m/d/yyyy H:i:s or mm/dd/yyyy H:i:s...
and format it like... yyyy-mm-dd H:i:s
I can format either of the two inputs into my desired format, but not both.
...
Hi all,
What's the best way to perform fulltext searches across rich media files? I'm trying to implement a system where the user could upload random files (.doc, .pdf, .jpg, ...) and down the line, he would be able to search for them based on the file contents or metadata.
I would appreciate some ideas on how to build this.
PS - I st...
I'm trying to save UTF-8 characters with Zend_Cache (like Ť, š etc) but Zend_Cache is messing them up and saves them as Å, ¾ and other weird characters.
Here is a snippet of my code that saves the data to the cache (the UTF-8 characters are messed up only online, when I try it on my PC on localhost it works ok):
// cache the external d...
Hello all,
I have got stuck with a question I have just been helped on - its a new problem but only just slightly.
I have this preg_match to get the contents of href. Please don't tell me not to use regex - I am aware of using other parsers/classes etc but this is an old script that just needs to be fixed for now. :) No time for re-wri...
Hello,
I'm building a CMS for a client (Building on top of wordpress). I'm having an issue with some data I am returning from my database.
Basically I am building Javascript Objects from PHP data so that I can update certain areas of my site upon mouse click.
example (this would work fine):
<script language = "Javascript>
var myOb...
Why between those dates i get 5,9.... and if i use another year i get 6 ???? It only happens with march and 2008... why is there an hour difference ???
<?php
$from = '2008-03-04';
$to = '2008-03-10';
echo datediff($from,$to);
$from = '2010-03-04';
$to = '2010-03-10';
echo datediff($from,$to);
function datediff($from,$to)
{
...
Using PHP I'm attempting to take an HTML string passed from a WYSIWYG editor and replace the children of an element inside of a preloaded HTML document with the new HTML.
So far I'm loading the document identifying the element I want to change by ID but the process to convert an HTML to something that can be placed inside a DOMElement i...
As a PHP/Web Developer, I'm a huge fan of MVC (Model-View-Controller). I love building an app on a solid foundation which definitely separates business logic, presentation logic, and flow of control.
However, I do a lot of work as well on server-side-only apps, which merely process data and log the process and any relevant results (such...
hello
i want to upload files using PHP but the problem is that i don't know how many files i will upload, my question is how can i upload files if i use file[] ?
<form action="upload.php" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label><input type="file" name="file[]" id="file" />
<br />
<label for="fil...
| and || - what is the difference between these two operators in PHP?
...
I have one table GAMES and another PLAYERS. Currently each "game" has a column for players_in_game but I have nothing reciprocating in the PLAYERS table. Since this column is an array (Comma separated list of the player's ID #s) I'm thinking that it would probably be better to have each player's record also contain a list of the games th...
http://domain.name/1-As Low As 10% Downpayment, Free Golf Membership!!!
The above url will report 400 bad request,
how to convert such title to user friendly good request?
...
I'm developing a simple chat web application based on the MSN protocol. The server communicates with the MSN server through a file resource returned from fsockopen (). The client accesses the server via XMLHttpRequest. The server initially logs in, and prints out the contact list (formatted in an HTML table) which the client receives thr...
I'm trying to organize classes in a project in a fashion similar to:
$TheRoberts = new family;
class family {
public function __construct() {
$bobby = new father;
$cindy = new daughter;
}
}
class father extends family {
function PayBills() {}
function GoToWork() {}
}
class daughter extends family {
...
I have created a simple checkout form for use with a mobile website:
<form action="" method="GET">
First Name:<br />
<input type="text" name="firstname" />
<br /><hr />
Last Name:<br />
<input type="text" name="lastname" />
<br /><hr />
Phone Number:<br />
<input type="text...
I looking to sum three values of the price field if selected.
$sql = "SELECT * FROM shoes
WHERE tray on tray.product_id = shoes.id";
$sth = mysql_query($sql);
$variety = mysql_fetch_array($sth)) {
echo'<div>
<p>'. $variety['name']. '</p>
<p class="price">'. $variety['price']. '</p>
<input name="price" type="checkbox" value="" />
...
I get an XML string from a certain source. I create a DOMDocument object and load the XML string into it (with DOMDocument::loadXML()). Then I navigate through the XML doc using various methods (e.g. DOMXPath), until I find the node (a DOMNode, of course) that I want.
This node has a bunch of descendants, and I want to take that entire...
The official website seems only provided some tutorial on how to use:
http://www.symfony-project.org
But I want to know why the directories should be setup like this
...
I’m sure my terminology is wrong, which is probably the reason google isn’t helping me. Anyways here is my problem and maybe you can deduce what my real question is...I hope
Ok let’s say I have a table called MOVIE this table has the values (columns?) for Name, ReleaseDate and Staring now my issue is how do i have the Staring value cont...