|
|
|
| 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 2 times) |
| Viewed : |
5422 |
| 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 recursive function to traverse a multi-dimensional array where the
dimensions are not known Categories : Arrays, PHP, Algorithms | | | 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 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 | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | | | clearing variables in php3 Categories : Variables, Arrays, PHP | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | PHP Random rss feeds - selects 49 random feeds from an unlimited list and displays them on your website. It's Ideal for those moments when you got 5 minutes and dont know which one of your feeds to read. Categories : PHP, Rich Site Summary (RSS), Arrays | | | Display list of files within current and subdirectories (recursively) showing
each file as an anchored link and each directory as a category header. Categories : Filesystem, Directories, Arrays, PHP | | | Password Creator: This PHP code exmaple shows how to use bitwise operations on a single variable and using it as a flagged variable. The class generates passwords of a given length using specified characters and the flags. Categories : PHP, PHP Classes, Algorithms, Security | | | PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character. Categories : PHP, Algorithms, Security, Authentication, Encryption | | | Stock quotes from yahoo! Categories : PHP, Web Services, Arrays | | | PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside. Categories : PHP, Arrays, Variables | | | XML To Array Categories : PHP, PHP Classes, XML, Arrays | |
|
|
|