Jump to content

[SOLVED] Function


MarcusZ

Recommended Posts

Hi!

This script is supposed to shorten the sms-message to only a number.

The function is not executed when running the script which gives me the same string that I inserted.

What do I do wrong?

 

<?php

 

$sms = 'sunds nv1b 5';

 

function deleteSMS($delete_txt)

{

$sms = str_replace($delete_txt, '',$sms);

}

 

deleteSMS('sunds');

deleteSMS('nv1b');

deleteSMS(' ');

 

echo $sms;

 

?>

Link to comment
https://forums.phpfreaks.com/topic/171390-solved-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.