Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
2.9k views
in Q2A Core by
hi to all

in qa-app-format.php i want to edit it

in this array :

return array(
                'data' => qa_html(strtr(qa_lang(($stampyear==$thisyear) ? 'main/date_format_this_year' : 'main/date_format_other_years'), array(
                '^day' => date((qa_lang('main/date_day_min_digits')==2) ? 'd' : 'j', $timestamp),
                    '^month' => qa_lang('main/date_month_'.date('n', $timestamp)),
                    '^year' => date((qa_lang('main/date_year_digits')==2) ? 'y' : 'Y', $timestamp),
                ))),
            );

i want to get year , month and day as string.but its return me array.

how can i do it?

thanks
Q2A version: Latest Version

1 Answer

+1 vote
by
selected by
 
Best answer
Where you catch the returning array, just parse it to a string, e.g.:

$yourstring = (String)$retArray['^day'].(String)$retArray['^month'].(String)$retArray['^year'];

This should do it.
by
thanks , its not work.
        $retArray = array(
            'data' => qa_html(strtr(qa_lang(($stampyear==$thisyear) ? 'main/date_format_this_year' : 'main/date_format_other_years'), array(
                '1' => date((qa_lang('main/date_day_min_digits')==2) ? 'd' : 'j', $timestamp),
                    '2' => qa_lang('main/date_month_'.date('n', $timestamp)),
                    '3' => date((qa_lang('main/date_year_digits')==2) ? 'y' : 'Y', $timestamp),
                ))),
            );

 $yourstring = (String)$retArray['^day'].(String)$retArray['^month'].(String)$retArray['^year'];
i want to get each value item (month,year,day) and send it to gregorian_to_jalali('year','month','day') to convert to persian date format.
by
gregorian_to_jalali((String)$retArray['^year'],(String)$retArray['^month'],(String)$retArray['^day'])
by
edited by
thanks.
i could send it to gregorian_to_jalali();
works fine. ;)
...