Last active
August 28, 2019 20:55
-
-
Save caionorder/d9fba6b2c8d1abd33e800e93027e4f59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function implodador($string, $insere = "<!--nextpage-->", $intervalo = 400){ | |
$local_insere = $intervalo; | |
$contadorFull = strlen($string); | |
$contadorSemHtml = 1; | |
$flag = 0; | |
$textExemplo = str_split($string); | |
foreach( $textExemplo as $letter ){ | |
$letter." = ".$contadorSemHtml.""; | |
if($letter == '<') | |
$pausa = true; | |
else if($letter == '>') | |
$pausa = false; | |
if(!$pausa) | |
$contadorSemHtml++; | |
$newText[] = $letter; | |
if($contadorSemHtml == $local_insere){ | |
$flag = 1; | |
$local_insere = $local_insere+$intervalo; | |
} | |
if($flag == 1 && $letter == "." ){ | |
$newText[] = $insere; | |
$flag = 0; | |
} | |
} | |
return implode('', $newText); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment