Jump to content

Eliminar e modificar texto


cherlick
 Share

Recommended Posts

for($j=0;$j<count($ler);$j++)
                {
                        if($procura[$j]=="use")
                        {
                                if($_POST['use']!="")
                                {
                                        $ler=(str_replace($procura[$j+1],$_POST['use'],$ler));
                                }
                        }
                }

aqui tem uma das partes do codigo que tenho andado a fazer

so que la esta.. por exemplo tenho cher e cherlick no texto

quero mudar cher para carro e isto esta me a fazer o seguinte:

cher -> carro

cherlick-> carrolick

Se me poderem ajudar agradecia 😉

Link to comment
Share on other sites

for($j=0;$j<count($ler);$j++)
                {
                        if($procura[$j]=="use")
                        {
                                if($_POST['use']!="")
                                {
                                        $ler=(str_replace($procura[$j+1],$_POST['use'],$ler));
                                }
                        }
                }

aqui tem uma das partes do codigo que tenho andado a fazer

so que la esta.. por exemplo tenho cher e cherlick no texto

quero mudar cher para carro e isto esta me a fazer o seguinte:

cher -> carro

cherlick-> carrolick

Se me poderem ajudar agradecia 😉

mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )

Através do parâmetro $count, podes definir quantas vezes ele substitui.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.