Goto Page: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
Actual Results
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Order Items of an Array by quanity?
- Subject: Order Items of an Array by quanity?
- Replies: 3
- Views: 556
- Subject: Order Items of an Array by quanity?
Posted: October 12th, 2011, 8:53 am
Oh and as a side note, I am talking about PHP here, sorry! 
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Order Items of an Array by quanity?
- Subject: Order Items of an Array by quanity?
- Replies: 3
- Views: 556
- Subject: Order Items of an Array by quanity?
Posted: October 12th, 2011, 8:49 am
Lets say I have an array like so:
And I want to print it like so: apple - 3 pear - 2 orange - 1 How would one do that? Do I need to lo...
Code: [ Select ]
Array ( [0] => apple [1] => pear [2] => apple [3] => orange [4] => pear [5] => apple )
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: URL Redirect Help Need - YYCELS
- Subject: URL Redirect Help Need - YYCELS
- Replies: 1
- Views: 686
- Subject: URL Redirect Help Need - YYCELS
Posted: January 30th, 2011, 8:31 am
in your htaccess file put something like: [code] Options +FollowSymlinks RewriteEngine on redirect 301 /upper_subcat.php?id=Ng==&cat_id=Mg== http://www.YourDomain.com/index.html redirect 301 /upper_subcat.php?id=Ng==&cat_id=OA== http://www.YourDomain.com/i...
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: MySql select column names
- Subject: MySql select column names
- Replies: 1
- Views: 1161
- Subject: MySql select column names
Posted: January 30th, 2011, 8:26 am
I had a simular issue recently, and I had to write a series of IF statements. It wasn't very clean, but it worked.
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Delete all files in a directory with PHP.
- Subject: Delete all files in a directory with PHP.
- Replies: 1
- Views: 1334
Posted: January 30th, 2011, 8:16 am
I am trying to write a script that deletes all the files for a directory called "cache". My plan is to get this working and then setup a cronjob to run every hour so my server doesn't get filled up with wasted crap. So, anyways, heres what I have so far, and for some reason its not working...
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Best way to create a multidimensional array w/this loop?
- Subject: Best way to create a multidimensional array w/this loop?
- Replies: 5
- Views: 2668
Posted: August 11th, 2010, 11:57 am
spork wrote:
I'm confused; the loop I provided creates the exact structure you indicated.
yah, I see that now. My bad, and thanks a ton.
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Best way to create a multidimensional array w/this loop?
- Subject: Best way to create a multidimensional array w/this loop?
- Replies: 5
- Views: 2668
Posted: August 11th, 2010, 11:52 am
You can push entries onto the end of an array by simply assigning to the array with an empty index:
oh, wait, my bad spork, I see what you are ...
PHP Code: [ Select ]
$data = array(); foreach ($x as $value) { $data[] = array($value[0], $value[1], $value[2], $value[3]); }
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Best way to create a multidimensional array w/this loop?
- Subject: Best way to create a multidimensional array w/this loop?
- Replies: 5
- Views: 2668
Posted: August 11th, 2010, 11:50 am
You can push entries onto the end of an array by simply assigning to the array with an empty index:
Yeah, that will work to create a normal arr...
PHP Code: [ Select ]
$data = array(); foreach ($x as $value) { $data[] = array($value[0], $value[1], $value[2], $value[3]); }
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Best way to create a multidimensional array w/this loop?
- Subject: Best way to create a multidimensional array w/this loop?
- Replies: 5
- Views: 2668
Posted: August 11th, 2010, 11:27 am
So I have a loop that cycles through some data that I am pulling from an API. Whats the best way to create a multidimensional array with it? In the past I just make the array with array_push() but I am not sure how to do the same with multidimensional arrays. The array that I need to build is below ...
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: How I do convert this date string in PHP?
- Subject: How I do convert this date string in PHP?
- Replies: 7
- Views: 6045
Posted: July 20th, 2010, 7:37 am
So, I am working with an API that outputs dates like this: 2010-07-20T13:57:11+0000 But my application requires that dates be in RFC822 format. Therefore I am trying to convert like so...
However, this outputs the date as: Wed, 31 De...
PHP Code: [ Select ]
<?php $date = date(DATE_RFC822, $date_string); ?>
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Printing unique elements from MySQL Arrays??
- Subject: Printing unique elements from MySQL Arrays??
- Replies: 2
- Views: 745
Posted: June 29th, 2010, 11:49 am
AWESOME! GROUP BY title works like a charm! Thanks!
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: Printing unique elements from MySQL Arrays??
- Subject: Printing unique elements from MySQL Arrays??
- Replies: 2
- Views: 745
Posted: June 29th, 2010, 11:37 am
So, I have a MySQL table that holds ZIP codes, City, and State names. I want to list all the cities for each state, however, because many times there is more than one ZIP for each city I am having trouble listing each city only one time each. You can see my code below. I have tried using array_uniqu...
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: How do I include hyphens in a htaccess regex?
- Subject: How do I include hyphens in a htaccess regex?
- Replies: 2
- Views: 1940
Posted: June 15th, 2010, 1:26 pm
Thanks a ton Spoof! For your hospitality. Samuele L Jackson is pleased.

- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: How do I include hyphens in a htaccess regex?
- Subject: How do I include hyphens in a htaccess regex?
- Replies: 2
- Views: 1940
Posted: June 15th, 2010, 10:50 am
I am currently rewriting URLs with a htaccess file to create cleaner URLs. Here is my htaccess file:
With this regex I am able to h...
Code: [ Select ]
Options +FollowSymlinks RewriteEngine on RewriteRule ^([a-zA-Z0-9]+)/$ /page.php?s=$1 RewriteRule ^([a-zA-Z0-9]+)$ /page.php?s=$1
- RedBMedia
- Forum: Programming / Scripting / Coding Forum
- Topic: A stupid question about SQL injection attacks in PHP....
- Subject: A stupid question about SQL injection attacks in PHP....
- Replies: 5
- Views: 685
Posted: May 13th, 2010, 3:15 pm
Oh, I see, so the attacker might spoof the header.....never thought of that.
