Was ist (Zeichenfolge) in PHP
Posted: 05 Feb 2025, 03:59
Während ein älterer PHP -Code mit einem Online -System überprüft/aktualisiert wurde, gab die Ausgabe an, dass ich (String) in mehreren Postvariablen haben sollte, wie z. B.:
$info = pathinfo((string) $_FILES['receipt']['name']);
< /code>
anstelle von < /p>
$info = pathinfo($_FILES['receipt']['name']);
< /code>
< /li>
$name = strtoupper((string) $_POST['name']);
< /code>
anstelle von < /p>
$name = strtoupper($_POST['name']);
< /code>
< /li>
$arrdate = date("j M Y", strtotime((string) $trdate));
< /code>
anstelle von < /p>
$arrdate = date("j M Y", strtotime($trdate));
< /code>
< /li>
< /ul>
Ich bin mit diesem Aspekt nicht vertraut und frage mich, was es tut und warum es benötigt wird? Der Code hat ohne die (Zeichenfolge) gut funktioniert.
$info = pathinfo((string) $_FILES['receipt']['name']);
< /code>
anstelle von < /p>
$info = pathinfo($_FILES['receipt']['name']);
< /code>
< /li>
$name = strtoupper((string) $_POST['name']);
< /code>
anstelle von < /p>
$name = strtoupper($_POST['name']);
< /code>
< /li>
$arrdate = date("j M Y", strtotime((string) $trdate));
< /code>
anstelle von < /p>
$arrdate = date("j M Y", strtotime($trdate));
< /code>
< /li>
< /ul>
Ich bin mit diesem Aspekt nicht vertraut und frage mich, was es tut und warum es benötigt wird? Der Code hat ohne die (Zeichenfolge) gut funktioniert.