The thing to be aware of, of course, is that there is no well-defined meaning to "the count of second dimension of a two-dimensional array", because PHP doesn't have such a beast. What it has is a one-dimensional array each element of which is itself a one-dimensional array.
So just because one element of the first dimension happens to have a certain length, that doesn't automatically mean that every other element has the same length.
On the other hand, if your implementation is such that you can guarantee that each element of the first dimension array is of the same length, then you only need to look at the length of any one of its elements (since we're assuming they're all the same length anyway it doesn't really matter).
So (still assuming that the three arrays $link['url'], $link['text'] and $link['img'] are all the same length), then there are count($link['url']) triples.
You should consider trexx's other suggestion, though, and have your triples along the second dimension. That is, instead of $link['url'][$i], have $link[$i]['url']. In other words, have an array of triples, not a triplet of arrays. Then the number of triples is trivial: count($link).