I don't have knowledge about PHP , Curently I'm doing asp.net mvc 5 project in that I want to convert following php code snippet to asp.net mvc which is C# programming language.
to do this easily I just did some research and I saw there is tool to do this. which is PHP to ASP.NET Migration Assistant . But its not working at all
there for I have to do this manually , really appreciate suggest way to do this
$p1 = $p2 = []; if (empty($_FILES['id']['name'])) {
echo '{}'; return; }
for ($i = 0; $i < count($_FILES['id']['name']); $i++) {
$j = $i + 1; $key = '<code to parse your image key>';
$url = '<your server action to delete the file>';
$p1[$i] = "<img style='height:160px' src='http://path.to.uploaded.file/{$key}.jpg' class='file-preview-image'>",;
$p2[$i] = ['caption' => "Animal-{$j}.jpg", 'width' => '120px', 'url' => $url, 'key' => $key]; }
echo json_encode([ 'initialPreview' => $p1, 'initialPreviewConfig' => $p2, 'append' => true ]);