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
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.