|
|
|
| Title : |
minus - subtract arrays. Send two arrays and get an array with the operation A-B, elements on A that are not included on B. |
| Categories : |
PHP, Arrays, Algorithms |
 jose di |
| Date : |
Feb 15th 2001 |
| Grade : |
1 of 5 (graded 3 times) |
| Viewed : |
12889 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by jose di |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
<?php
function RestaDeArrays($vectorA,$vectorB)
{
$cantA=count($vectorA);
$cantB=count($vectorB);
$No_saca=0;
for($i=0;$i<$cantA;$i++)
{
for($j=0;$j<$cantB;$j++)
{
if($vectorA[$i]==$vectorB[$j])
$No_saca=1;
}
if($No_saca==0)
$nuevo_array[]=$vectorA[$i];
else
$No_saca=0;
}
return $nuevo_array;
}
?>
how to use it--->$result=RestaDeArrays($arrayA,$arrayB); |
|
| A class to put get and post variables in hidden form
elements. Works on scalars, normal arrays, associative
arrays. Categories : Algorithms, Variables, Arrays, PHP, PHP Classes | | | quick sort for associative arrays Categories : Algorithms, Arrays, PHP | | | A simple bubblesort that takes 2 arrays as argument.The first one is the actual data used for sorting, the second is data that will "tag along" with the first array, for instance a descriptive text about the data in the first array. Categories : Algorithms, Arrays, PHP, Complete Programs | | | A recursive function to traverse a multi-dimensional array where the
dimensions are not known Categories : Arrays, PHP, Algorithms | | | This script will read all images from a folder and read the files into an array. It uses rand() to get a random number. It will display a random image from the image folder given. Categories : PHP, Arrays, Graphics, Filesystem | | | This functions makes it easy to use session-variables known from ASP. With one Cookie the array "session" will save and restore from a db-record. In this version MySQL is used but it's should very easy to change Categories : PHP, Arrays, Cookies, MySQL, Databases | | | How to validate an Israeli ID number. Categories : Ecommerce, PHP, Algorithms | | | Compare two texts and display a block of text with the differences between them. Categories : PHP, PHP Classes, Filesystem, Strings, Arrays | | | XML To Array Categories : PHP, PHP Classes, XML, Arrays | | | Can the word DO be used in arrays? Categories : Arrays, PHP, Strings | | | WWW interface to Unix Manual(phpMan)
Categories : Program Execution, Strings, Arrays, PHP | | | Get TemplateMonster data Categories : Arrays, Ecommerce, PHP, Strings | | | Tweak Array, insert/add elements to any position of your arrays - delete elements from your arrays - move elements within your arrays - replace elements from your arrays ... the array, 'dynamically' grows or shrinks to whatever we tweak it. Categories : PHP Classes, Arrays, PHP | | | Fast PI calculator. Can easily find the 1000th decimal place of pi in 5 seconds. Categories : PHP, BC math, Algorithms | | | How to pass an array to a function, or how to define a
function wich recieves an array. Categories : Variables, PHP, Arrays | |
| |
| |
|