tags:

views:

100

answers:

2

I have string like "Venditoris: Beware of Scams » Blog Archive » Trilegiant Complaints ..." in Database but when I try to display it ,It is not displaying. So,I used html_entity_decode function but still it is not display.

I am Using cakePHP.below is my code to display that links.

echo $html->link(html_entity_decode(
    $listing_end_arr[$i]['Listing']['listing_title'],ENT_QUOTES),
    $listing_end_arr[$i]['Listing']['listing_url'],
    array('target'=>'_blank', 'style'=>'color:' 
          . $colorArr[$listing_end_arr[$i]['Listing']['listing_sentiment']])) ; 

Please Help me.

+1  A: 

inspect generated html first.. your code should echo a link, maybe it's just not visible (styling, color..).

parserr
A: 

Check the CakePHP manual if you are using $html->link correctly. If so, var_dump the return value instead of echoing it. If it is empty, do

var_dump( $listing_end_arr[$i]['Listing'] );

to see what the Listing key contains. If the desired content is not in the dump, you know the error is elsewhere; probably in fetching the string from where it is stored.


Also, instead of using array[n][foo][bar][baz], consider assigning the subarray to a variable while looping over the array, e.g. $listing = array[n][foo][bar], so you can just do $listing[baz]. This will dramatically increase readability of your code.


Like suggested in the comments already, please go back to some of your previous questions and accept the most helpful answers. Your accept rate is horribly low and many users, including me, are reluctant to help users that deny to appreciate the help they are given, especially when it is as simple as clicking a button.

Gordon