Note that there are some explanatory texts on larger screens.

plurals
  1. POunserialize arabic letters rendering ??? as output
    primarykey
    data
    text
    <p>i have the following bit of code:</p> <pre><code>function appear($data) { $output = ''; $unsee = unserialize ( $data ); if (is_array ( $nsee )) { $output .= '&lt;table&gt;' . ""; foreach ( $nsee as $button ) { $output .= loadbutton ( $button); } $output .= ' &lt;tr&gt;&lt;td&gt;IP&lt;/td&gt; &lt;td&gt;' . $_SERVER ['REMOTE_ADDR'] . '&lt;/td&gt;&lt;/tr&gt;' . ""; $output .= '&lt;/table&gt;' . ""; } return $output; } function loadbutton($button) { $output = ''; $output .= '&lt;tr&gt;' . ""; $output .= '&lt;td&gt;'; $output .= $button ['values']; $output .= '&lt;/td&gt;&lt;td&gt;'; $output .= $_POST [strtolower ( $button ['values'])] ; $output .= '&lt;/td&gt;' . ""; $output .= '&lt;/tr&gt;' . ""; return $output; } </code></pre> <p>when i use the appear function for the english serialized data, it works perfectly and outputs fine.</p> <p>But when i use it for the arabic serilaized data. everything works except the arabic letters appear as "????" and not as actual arabic letters.</p> <p>I have verified the data in the database, everything is UTF-8, and everything is valid db wise and saving serilaized wise. but the output and unserialization is incorrect.</p> <p>Do you know a way to fix this? Does unserialization support arabic letters? if not then why does it save arabic letters correctly but not fetches them?</p> <p><strong>EDIT:</strong></p> <p>The problem i believe is in the call $button ['values'].</p> <p>my <code>$button</code> array is <code>array ( 'values' =&gt; 'Field Value')</code></p> <p>no solution comes to mind. i know it should work.</p> <p><strong>SOLUTION:</strong></p> <p>The problem was in my mysql insert statement of the serialized data. i was inserting in latin. a simple, idiotic mistake.</p> <p>Thank you for your help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload