I need a regular expression that, given an ingredient line, will tell me the quantity of that ingredient. Here are some sample values:
8 ounces semisweet chocolate
6 eggs
3/4 cup sugar
1-tablespoon espresso powder
1/2 cup Dutch processed baking cocoa
1/4 cup unsweetened cocoa
1/2 cup confectioners' sugar
2 cups heavy cream
2 to 4 dried...
How to do it in one query?
...
Ok lets say I have div with form elements inside of it. I want to be able to clone that div with a button click using jQuery and add a version 2 of the form, so ALL of the element IDs will increment by 1 in their name.
<div id="card">
<!-- PART 1 -->
<h1 class="card_build">Build your card options:</h1>
<select id="country...
I have inherited a site with a news section that displays a summary of the news article. For whatever reason the creators decided that displaying the first X characters of the article would be fine. Of course this very quickly led to the summary being something like:
<p>What a mighty fine <a href="blah">da
<p>What a mighty fine and warm...
I would like to make a list to show the user´s friends, that are online.
users
id | firstname | lastname | last_access
users_friends
uID | bID | type | accepted
That is how my tabels look like.
Firstly I have the user´s id in $USER.
The $USER´s id is stored in a row, in users_friends, at column "uID". bID is the id of the friend....
Hi guys - extreme novice here playing with PHP/MySQL trying to teach myself online but can't figure this out for the life of me...
I have been following a PHP tutorial at http://www.keithjbrown.co.uk/vworks/php/php_p5.php
This page is at tasmanianracing.com/horses.php
I'm getting the following mysql error:
You have an error in you...
Hi friends,
https://graph.facebook.com/search?q=India&type=post
i am using the above api of Facebook and i am getting following Output
{
"data": [
{
"id": "501585456_163489377008878",
"from": {
"name": "Ian Robinson",
"id": "501585456"
},
"message": "\"Media subdu...
Pretty straight forward question. I'm quite happy with my simple text editor but sometimes it'd be nice to run something like PyFlakes on my code before running to check for any obvious errors like undeclared variables or syntax errors.
...
I have three values that I want to pass via a link, but don't want them visible in the URL.
...
To learn more about a language I rewrite some of the core functions, or compare basic speeds of each set of functions per problem to see what is more suited in real world situations.
Other than an ugly online line-graph generator which often only allows one or two series, I cannot find anything that would suit what I need.
Do you know ...
I have set my monthly Archive page (Archive.php) as like this :
Monthly Archive
When clicking on any MONTH, the result will show all the posts for that particular month as below:
Post title-1 ------ Category-1 ------
Author name
Post title-2 ------ Category-1 ------
Author name
Post title-3 ------ Category-1 ------
Author name
Post tit...
I found a link in a tweet that my current regex won't parse and I can't seem to figure out how to get it working (probably due to my ineptness with regex).
Here's the current code:
preg_match_all('@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@',$description, $matches, PREG_SET_ORDER);
And the Tweet that won't p...
We have variable $menu with HTML inside (there is no loop, it comes from a function).
On echo it gives the code like this:
<ul id="menu">
<li id="some-id" class="many classes one"><a href="#">text</a></li>
<li id="some-id" class="many classes second active"><a href="#">text</a></li>
<li id="some-id" class="many classes thre...
I have an object, that I would like to interact with dynamically. I would like to rename the game1_team1 in:
$default_value = $individual_match->field_match_game1_team1[0]['value'];
to be game1_team2, game2_team1, game2_team2, game3_team1, etc. Based on the loop they are in.
I have tried:
$dynamic = 'field_match_game'.$i.'_team'.$j;...
Hi all,
I’m trying to extract some numbers ranging from 1-99 from a picture. I’ve tried several OCR methods using PHP, but eventually my script will fail, since the numbers occasionally is rotated 5% to the left or right. This making the picture not being recognizable.
View example of my numbers: http://d.imagehost.org/view/0373/screen...
I'm using the zend framework. From within my phtml file, I am trying to call a link to a swf file that is outside of my web directory.
The code for this link is:
<?php echo getcwd(); ?>
<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="/message/get-file/messageId/<?php echo $this->messag...
Hello guys
How can I set SEO friendl urls like http://bodyharmonynutrition.com/eating-a-heart-healthy-diet/ in my site ?
Thanks a lot for your time
...
Hi,
How can div wrapper grow with img size?
<div style="width:900px;">
<div style="width:100%;">
<div>some text......</div>
<img src="<?php echo $imageSrc; ?>"/>
<div>some text......</div>
</div>
</div>
Thanks
...
I have created my own framework for my websites and it is around 410 KB. What should be the best framework size and does code size really matters? If there are some functions which are not being utilized on a page removing them will make any difference in page loading?
...
Using cURL with an accented URL, I cannot get content if CURLOPT_RETURNTRANSFER = true.
Example:
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://fr.wikipedia.org/wiki/Été");
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec ($curl);
echo $html;
$html is empty, does someone have a solution ?
...