Jump to content

String - Get Text After @


BrendanMullan

Recommended Posts

Hi all just a bit like twitter i have a message system where when one recieves a mail i want there username to be like @user in blue but when sending a message the @user is in the message itself along with the actual message itsself, so i am trying to get the @ and everything after it so i can then change its color, can anyone help with this?

Link to comment
https://forums.phpfreaks.com/topic/236466-string-get-text-after/
Share on other sites

On second thoughts i have

 

<?php
if ($mto == $user){
echo"<font style='font-size: 14px;'>".$row2['message']; ?><br></font>
<?php
}else{
echo "<font color='red'>@".$mto."</font>"; echo " "; echo $row2['message'];
}
?>

So if i send a message to no one it will echo out normal but if i send it to someone else

it will spilt the message and get the first word which is there user @user, but after

@user i want to display the mesasage but putting $row2['message']; in will diaply the

@user again because when sending a message you need to include @user at the start , how can i get rid of that after i have grabbed it from the string?

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.