if logic that figures into it a minumum string length

hi

the attached code works great -

<li " . ($value['link']=="faqs" ? "style=\"padding:0 2px 0 2px;\"": "").">

says that if the parameter is "faqs" add padding to the <li>

i'm wondering if there's a way to do this but instead of ($value['link']=="faqs"  being the parameter, some sort of miniumum string length serving as the parameter instead like:


<li " . (stringlenth<4 characters ? "style=\"padding:0 2px 0 2px;\"": "").">

function showMenu ( $menu_array, $toplevel, $page, $subpage ) {
                global $d, $ak;
                
                //Display the top level elements.
                echo "<ul>\n";
                foreach($menu_array as $key => $value):
                        if ($toplevel):
                                $url = "index.php?page=" . $value['link'];
                                $active = ($page == $value['link']) ? "class=\"active\"" : "";
                        else:
                                $url = "index.php?page=$page&amp;subpage=" . $value['link'];
                                $active = ($subpage == $value['link']) ? "class=\"active\"" : "";
                        endif;
                        $target = menus::getTarget($value['target'], $url);
 
                        //If user is logged in, change login page link to read logout
                        if (count($_SESSION['clientuser']) && strcmp(strtolower($value['link']), 'sign_in') == 0)
                                $value['title'] = 'Logout';
 
                        //Do not show item if it is restricted in access and user is not logged in.
                        if ($value['restricted'] && !count($_SESSION['clientuser'])):
                        else:
                                echo "\t<li " . ($value['link']=="faqs" ? "style=\"padding:0 2px 0 2px;\"": "")."><a href=\"" . menus::checksef($url) . "\" $target $active tabindex=\"" . $ak->tabindex($key) . "\">". $value['title'] ."</a></li>\n";
                        endif;
                endforeach;
                echo "</ul>\n";
        }

Open in new window

phillystyle123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
try:
<li " . ( (strlen($value['link']) < 4) ? "style=\"padding:0 2px 0 2px;\"": "").">

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
phillystyle123Author Commented:
thanks hielo! - sorry for the delay
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.