I need a regular expression that will extract sentences from text that contain a year in them.
Example text:
Next, in 1988 the Bradys were back
again for a holiday celebration, "A
Very Brady Christmas". Susan Olsen
(Cindy) would be missing from this
reunion, Jennifer Runyon took her
place. This was a two hour movie in
wh...
I'm having trouble building a query. I can do what I want in 3 different queries.
SELECT id FROM table1 WHERE url LIKE '%/$downloadfile'
put that in $url_id
SELECT item_id FROM table2 WHERE rel_id = '$url_id'"
put that in $item_id
SELECT rel_id FROM table2 WHERE rel_id = '$item_id' AND field_id = '42'"
put that in $user_id
But from re...
Hi, I'm trying to get the unix time for date strings that are formatted like so:
'second sunday of march 2010'
'first sunday of november 2010'
I was under the impression that strtotime could handle such a string, but apparently not, as this returns false. How can I convert to unix time when given a day of week, which one of those in t...
I'd like to create a function that retrieves the post count for a given query. I don't want to use get_posts obviously as its way to expensive for this purpose. However, that's exactly what I'm having to use in absense of a get_post_count function.
My code is...
global $post;
$cat=get_cat_ID('mymenu');
$catHidden=get_cat_ID('hidden');
...
On our own website, it's easy to protect against direct links to our video content by grabbing a token through AJAX and verifying the token through PHP before the file download is started.
However I'm also researching how I could provide an embed feature, like YouTube or vimeo etc., without compromising this security feature.
The probl...
Explanation
I have a multidimensional array that is iterated over to created a categorized view of people with different research interests. The main array look something like this:
Array
(
...
['Cell Biology'] => Array(4 elements)
['Molecular'] => Array(6 elements)
['Biology Education'] => Array(14 element...
Can anyone explain if it is possible to have a web server for all of these technologies:
ColdFusion, PHP, MS SQL Server, MySQL
I have a web developer insisting that they require all of the above however it doesn't quite make sense to me.
Any help or clarification is appreciated.
...
Hi all,
I would like to create a multi-dimensional array with two variables but don't know how.
This is what i have so far;
$_SESSION['name'][] = $row_subject['name'];
$_SESSION['history'][]= $_SERVER['REQUEST_URI'];
I wanted to know if this is possible?
$_SESSION['name'][] = $row_subject['name'],$_SERVER['REQUEST_URI'];
i want...
Hi, I'm trying to create a basic shopping cart, having an issue with the product page allowing users to add more items to their cart then are in stock (I have code in place to prevent this on the view cart page, just not the view product page)
This is what I have so far;
for ($i = 0; $i < $numItem; $i++) {
extract($cartContent[$i]);
$s...
Hi All,
This is probably something really simple, however I am quite new to PHP, and havent done any HTML in years.
I need to get a PHP variable filled with an array of figures into Google Charts. My code for this so far is:
<img src="http://chart.apis.google.com/chart?
&chs=340x175
&chd=t:<?=$filedetail[1]?>
&cht=lc
&chtt=Test
">
H...
Ok, I attempted at making my own search function which doesnt work very well.
It consists of eliminating useless words such as "how" "you" "to" then using a premade Stemmer class that reduces words to their root so "Appointments" searches "appoint"
However in the end I'm really only searching keywords and the results are not very accu...
Hello,
For the join query below, I would like to pull some data from a third MySQL table called "comment." Each s.title has a corresponding s.submissionid. The field "submissionid" is also the in the table "comment."
For each "submissionid" in the table "comment," I would like to count a field called "commentid."
How can I do th...
I'm managing a set of web apps, almost exclusively written in PHP, and would like to find an authentication platform to build a role-based authorization system on top of. Also, I'd like the authentication system to be extensible to use for, for example, system services (SSH, etc.)
Here are some of the main characteristics I'm looking fo...
I'm trying to find a way to return the value of an array's parent key.
For example, from the array below I'd like to find out the parent's key where $array['id'] == "0002".
The parent key is obvious because it's defined here (it would be 'products'), but normally it'd be dynamic, hence the problem. The 'id' and value of 'id' is known th...
I got the fire alarm phone call, AIM messages and email today from a client stating "The site is down!, WTF happened?!"
Well, after a little digging, it turns out one of the records in a table had been wiped clean, but without removing the row itself. So, I had the representation of data, but a bunch of empty fields. (needless to say ...
I have a form with 'selected' values pulled from the database.
Now I want the user to edit the values.
When the data is send I want to show the new values.
When I submit my form I always get the 'green' value?
What am I doing wrong here?
<?php
// pulled from db
$color = "blue";
// update
if (isset($_POST['Submit'])) {
echo "write ...
Hello everyone. I'm starting a new project and setting up the base to work on. A few questions have risen and I'll probably be asking quite a few in here, hopefully I'll find some answers.
First step is to handle dependencies for objects. I've decided to go with the dependency injection design pattern, to which I'm somewhat new, to hand...
I am making my first SOAPclient and I am stuck with the Headers, I am getting a response and when I look at my request it has a soap:body but no soap:headers. The web service has needs 3 parameters
1.UserName
2.Password
3.errorMessage
This is the code I have set up.
$SOAPAction = 'http://localhost/DriveAwayPriceCalculation/PriceCal...
I am using ffmpeg build for windows to make video thumbnails . The command works well in command line but not from PHP exec method. am using PHP 5.2.11
Here is the command.
"E:/Documents and Settings/x/WINDOWS/ffmpeg" -itsoffset -4 -v "E:/Program Files/Apache Software Foundation/Apache2.2/htdocs/bs/files/videogal/c08c3d20eeb9083ed0335...
I'm pretty new at this. Tried to make sense of the manual page for mcrypt at PHP.net when I thought a good tutorial would do a better job. So I searched yet without anything substantial.
I also tried one of the examples of using mcrypt to perform the encryption and decryption with 2 functions, but it gives a warning of "Size of key is t...