anonymox
anonymox

Reputation: 419

Getting a specific array field length in php

I Want to get a specific field length from a Multidimensional Array but I don't know how and all I could find was sizeof(array) or count(array,count_recursive)

in javascript we can do this like :

var modalInfo = {
                        name : 'imagePreviewModal',
                        title : 'show picture',
                        wh : [500, 400],
                        tabs : [['imagePreviewTab', body]],
                        buttons : [],
            cancelButton : false
        };
window.alert(modalInfo.tabs.length);

body in : tabs : [['imagePreviewTab',body]], is and array.

what i need is the last line, i can get the length of modalInfo array field tabs. how can I do the same in php?

Upvotes: 0

Views: 105

Answers (1)

jedrzej.kurylo
jedrzej.kurylo

Reputation: 40909

This should work for you:

$count = count($modalInfo->tabs);

Upvotes: 1

Related Questions