how do i get the relation between the two array when both of them have values in some relation on the same indexes of both array for example,
i have retrieved “tagname” and “path” from one table of mysql and then i put these two column values in two arrays using loop so “array Tag[]” have vale “Introduction” and “array Path[]” have path value for introduction both values are on index “0” of there respected array and all data is collecten in “arrat Tag[]” and “array Path[]” in this manner after that i sort my “Tag” according to some other array using this code,
$sorted =array_intersection($some_other_array,$array Tag)
now how would i know the related path values for Tag as tag sorted ??
Hopes for your suggestions
from mysql/DB result set when you are creating array, create as
assuming your array as
sort your array as per need based on tag or sorting methods available.
in this case instead of int index it will have key as path
sorting with tag also binds it with path.
after sorting your array (assuming sorting with first letter alphabates of tag name)
so you can easily find path for your tag with
foreachloop with key and value or with aray_keys if you want particular tag path and you know the tag value.