ConFoo Montreal 2026: Call for Papers

Voting

: one minus one?
(Example: nine)

The Note You're Voting On

hyperzlib at outlook dot com
5 years ago
Use str_replace to remove all dashes but one from the string '-aaa----b-c-----d--e---f' (resulting is: '-aaa-b-c-d-e-f')

<?php
$challenge
= '-aaa----b-c-----d--e---f';
do
$challenge = str_replace('--', '-', $challenge, $count); while($count);
echo
$challenge;
?>

<< Back to user notes page

To Top