• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP - How to block some words from an variable

Gabriel Tibiano

New Member
Joined
Nov 21, 2009
Messages
420
Reaction score
4
as title says
I want to know how to block some words from a text variable

like..
PHP:
<?PHP

$one = '1A[sf5]2B[sf8]';

$two = '$one without [sf5], [sf8]'; //should show 1A2B, u know?

echo $two

?>
 
OH! This is unfair!
i just told him what he should do,
he is buying the service, if he wanted it for free he would post somewhere else
Then I'll tell you what to do: google. Ask your question in that magic box and you'll have your answer in some seconds.
 
and u're thinking that I haven't done this?? :pP

can't find anything clear there, that's why I came here
Honestly? no. Clear? how much clearer than what google offers do you want? you wrote the code in the post right? the results on google can easily be adapted if you spend a few minutes on it, you do not even have to understand what it does, just trial and error editing will get the thing working as you wish. If you are really "helpless" I can do this thing for you but I want something from you then, help that guy for free.
 
Try
PHP:
<?php
	$one = "1A[sf5]2B[sf8]";
	$two = str_replace(array("[sf5]", "[sf8]"), "", $one);

?>
 
Back
Top