if you used
[man]date/man; that would give you a numeric representation of the day of the week, starting from 0 as sunday to 6 saturday. you can decide which direction is closer to get to sunday, and the function [man]strtotime[/man] would be great to get sunday's date. with strtotime you can do things like this...
$sunday = strtotime("+3 days");
where 3 days is the number of days you figured until sunday, you can also go back days.
once you get that timestamp, you can use date again, to parse it just about any way you want.