Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一部の値に接頭辞と接尾辞を追加する必要があります。
例:
$value = 1234
$prefix = a
$Suffix = b
a1ba2ba3ba4b
PHPでの手順やサンプルコーディングを教えてください。
<?php $prefix = 'a'; $Suffix = 'b'; $value = 1234; $str = ''; $array = str_split($value); foreach ($array as $key => $value) { $str .= $prefix.$value.$Suffix; } print_r($str);