The phrase "pull the leg of" is a colloquial expression that means to joke with someone or tease them in a humorous way. There are many synonyms you can use to replace this phrase in your speech or writing. Some alternatives include "pull someone's chain," "mess with someone," "josh around," "rib someone," "kid with someone," and "trick someone." Using these synonyms will provide variety in your language and make your speech or writing more engaging. It is important to remember to use these synonyms sparingly, as they are colloquial expressions that may not be appropriate in all settings.